ActionScript 3.0 :: Can't Understand Block Of Code?
Dec 10, 2009i'm watching actionscript manual and can't understand this code, could you please explain what it is.
View 2 Repliesi'm watching actionscript manual and can't understand this code, could you please explain what it is.
View 2 RepliesSomething I've always wondered, but never got round to asking is should I use...
Code:
}
... or...
Code:
};
... at the end of a code block? What's the difference as I've seen both used but no explanation as to why?
How do we make an entire block of code (maybe 10 lines) as comment.
Maybe just to deactivate a code block when trouble shooting AS code.
I want a movieclip to appear in a drag and drop game. When you successfully drag the right object and drop it then an animation is called from the library.The animation doesn't appear. However, when I use the same code at the beginning of my programme it does appear so it's not that part of the code that is the problem. Also, a trace statement does trace so it is running the code.[code]...
View 7 RepliesI have a block of code in a game I'm making that checks to see if guy1 is in contact with guy 2:
Code:
var randomGuy1X:Number = Math.random()*550;
var randomGuy1Y:Number = Math.random()*400;
[code].....
Having done some programming in Groovy, I know you can write test code in the Groovy console. I classify this as true a scripting language as it doesn't force you to have a class definition. So I'd assume with a name like ActionScript with 'script' in it's name that, you can write a series of statements that act linearly, such as a sequence of variables assignments, their manipulation and dumping out a value.
My question is if this is possible, how do you go about doing it, in order to test some code with ActionScript3? Does the code have to exist in a package?Can the code exist on it's own? (If so, what would the name be you'd give to the source file in order to compile it from the command line?
Would you use mxmlc?
Would you use compc?
I've heard about fsch too. How about that?I also read about a command called 'asc' in R.Braunstein's AS3 Bible 2nd ed (P8), but don't even see this in the SDK bin folders.... So what's that all about? Assuming I've managed to compile this name.as file, how do I execute it and see results? Do I have to run it through a browser and the HTML template, or can I execute from a command line?
Do you have to have a class in the source to bypass this? Can the code block be placed outside a dummy class? If so, does it have to exist in a function? Or can it exist on it's own?Does it have to exist in a code blocks, by wrapping them in curly braces?
Warning 1106: Empty statement found where block of code should be expected. Did you type ';' accidentally? Here is the code:
Code: Select allif (MapCombo.selectedItem == "Westfield London Ground Floor")
{
function MapChoice(event:MouseEvent):void{[code]......
So i have an external as file which have a function. the function make the movie clip do something when it hit another object which i named "block."
but the external as file can't accses "block" movie clip which's added from the fla files and given an instance name as "block".
I was trying the flickr code provided in the learnwebsite, and I am getting this exception:
[RPC Fault faultString="Error #1090: XML parser failure: element is malformed." faultCode="Client.CouldNotDecode" faultDetail="null"]
at mx.rpc.http::HTTPService/http://www.adobe.com/2006/flex/mx/internal::processResult()
[code].....
I create game matching things. If icon 1 == icon 2 then i delete this icons. Player finish game when he match all icons. I try give points for correct unswers. And try to calculate this poits.
code:
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
[Code].....
my flash reads the xml, but does not understand the tag php. I want to read my xml dynamically
code:
stop();
function randomOrder(targetArray)
{
var _loc2 = targetArray.length;
[Code]....
Iknow what the function does, It get the information about the webcam in your computer and post it on the textArea,
private var camera:Camera;
private function list_change(evt:ListEvent):void {
var tList:List = evt.currentTarget as List;
[code].....
Is addChild for "maskContainer" necessary in the following scenario?
[Code]...
Ok I want to make a button that changes a text to count 21+ so lets say we have our button
Code:
button.onRelease = function()
{
[code].....
my aim is to catch when the session is invalidated and send message to all destination that the FlexClient subscribed that the client wiht id .... has disconnected. I implemented a service which listens for
[Code]...
Problem is that i want to catch messageClientDestroyed and send to that destination a message that the user has disconnected.But blazeds destroys messageClient when you add a subtopic.So how to understand that if session is invalidated and all messageClient are being destroyed or the user just enter another place and add a subtopic to his consumer. I'am also open for other solutions to implement that mechanism.When user disconnected by session timeout or closed the site browser etc. i wanna catch it and send a message to subscribed destinations.
I have no background in programming and at 49 it seems that I am having a hard time understanding AS3, especially AS3 OOP. I wonder if I should give up at this point. I have been studying AS3 for 3 months now. Here's what I don't get right now.:
[Code].....
I'm trying to understand the properties of the TextFormat class.[code]In the code above I defined my variable sir of type TextFormat (sir is an instance of the class TextFormat). What I want to do is to experiment some of the properties for that class.In the example above I want to make the string of type textformat class arial , align him to right, block indent=10, style bold etc.I made a switch here because I understood that function but I don't know how to integrate this to my first 2 lines of code to complete understand all properties of class TextFormat.[code]
View 2 RepliesI have created a Flash presentation that includes the standard playback flat > flat grey forward and playback flat > flat grey back buttons from the Windows > Common Libraries > Buttons list. These give me errors when I try to set an event handler to intercept a CLICK event from them. What type ov event should I be trying to set up to handle if CLICK isn't an option?
View 4 RepliesI use Flash Professional CS5.5 with Gaia FrameWork in my project. movieclips in the project have extended classes and the problem is that when I give new functionality to my classes they doesn't work in an build project. for example function s cann't be found, trace doesn't work and so on. All the old functionality works. When I change class name then it works fine. but then it happens again. I made new project and coped all the content, but still it happens. I event rainstalled flash but nothing works.
View 1 RepliesI am trying to understand why I am not able to launch a SWF from the URL after launching mvm jetty:run on my project.The project has built successfully and produced a Falcon-WAR-0.0.1-SNAPSHOT.war in the maven target directory. In this file are the following files - and includes the .swf file compiled from the Flex project.[code]The context root of my application is the same as the artifact ID of the WAR, so it is FALCON-WAR.When I launch mvn jetty:run, I get the following print to the console:However when I try to navigate to URL...on my browser, I get the following, when I expect to launch the .swf file from the web.xml definition.
View 3 RepliesI am trying to understand the method transition that falls in the Matrix Class. I am using it to copy pieces of a bitMapData. But I need to better understand what transitions do. I have a tilesheet that has 3 images on it. all 30x30 pixels. the width of the total bitmap is 90pxs. The first tile is green, the second is brown, and the third is yellow. If I move over 30pxs using the matrix that transitions, instead of getting brown, I get yellow, if I move over 60px, I get brown. If I move -30 pixels, then the order is correct. I am confused on what is going on.
[Code]....
Using TCP protocol. Client is Flash. Server is Java (on Linux). Is there anyway to understand if a message is successfully sent to target server in client (Actionscript 3) ?
View 1 RepliesI am a rails noob. I am having a problem conceptualizing how assets work in an authenticated system. All of the tutorials I've seen so far talk about putting your swfs in the public folder and embedding them in your view. However, the swf I'm using is a flex gui that should only be used by users logged-in through restful-authentication. I imagine that putting the gui into the public folder would be defeating the whole purpose of having an authentication system. So what is everybody doing to restrict access to this kind static content?
View 1 RepliesI maintain two web sites and am reasonably competent in Dreamweaver and Fireworks. Now to get into Flash.I want to produce a banner which shows a flag + Welcome in that language and have about 20 nations to cover. Can anyone please point me to a guide as to how to get this started?
View 1 RepliesI have a question: The following code, which works OK in Firefox and Safari, gets IE8 to throw a pop up block The simple code:
[Code]...
I've got an AIR app that is loading mx:HTMLs. I would like to block the ads that show in them just like Adblock Plus for Firefox does (see http://adblockplus.org/en/). I subscribe to the Easylist USA filter.
var req:URLRequest = new URLRequest("http://www.google.com");
thisHtmlWindow.open();
thisHtmlWindow.htmlContent.htmlLoader.load(req);
I don't know where to begin to interrupt the HTML GET-ting process in actionscript. This is where I suspect I can add the HTTP filter. It'd be nice to subscribe to the filter and periodically download it/update it to make sure the major ad networks are blocked.
why my code not workinghere is my as code
package com_dp
{
import flash.net.URLLoader;
[code].....
ok i'll try and explain this best i can, on my site i have a menu that takes up the whole of the content area.. the plan is that when the user clicks the menu button within a content page the menu would appear over the top however with a slightly transparent background so you can still see the last visible content page in the layer underneath.. i've got this to work however the buttons within the content page are still active.. is there a way i can make the menu layer 'solid' so the content below is only visible but not accessible?
View 5 RepliesFlash banner block up authorization div. Currently it looks like:
View 2 RepliesI am trying to make a pong like game but i need to find the offset from the center of the paddle so that i can make it bounce differently depending on where it hits the paddle. How can i achieve this?
View 1 Replies