actionscript-3

How to call a function in a Class from another Class?

Update: Modified title to better reflect my question Hi everybody :) My question today revolves around a CustomEvent I'm trying to send from one sub Class to another. I've used my CustomEvent class to pass an event from a sub Class to my main class fine, but I'm not sure who to do that between sub classes. My Custom Event Class pack...

How do I fix this cross-domain ActionScript 3 error?

I'm going to be as specific and verbose as possible and include some of the code I'm using. I already did a search and found this question, which seems similar; however the author there was using ActionScript 2 instead of 3, and I couldn't seem to apply any of the answers given to my own situation effectively. I am trying to emulate (in...

capturing bubbling key event from flash with javascript?

In IE, if flash has focus, and receives a keydown event, it does not appear to bubble the event up through the DOM (I can't capture the event by listening on document, however the same listener can capture key events from html siblings, so I know my listener is working). However, some other plugins on the page (I am looking at you windo...

buttons inside mc affecting the code

Hi, I have a movieClip with two buttons inside. The problem is that when the mouse is over these two buttons, the code that manages the movieClip stops working, as if the mouse is not over the MC (the buttons are children of the MC, shouldn't it work regardless?). Could you please share some advice? Thanks /*mc follows mouse. I can't ...

How to Prevent SWF from Decompiling?

How do I prevent my SWF from decompiling? Is there any difference between ActionScript 1/2 and ActionScript 3 in the perspective of decompile prevention? This is an opposite question of the following question: How do you decompile a swf file? http://stackoverflow.com/questions/97018/how-do-you-decompile-a-swf-file ...

Validator Components in Flex3 Air.

How to use validator controls like Required validator, integer validator etc in Air application? I tried to use them but I got this error: Component declarations are not allowed here. (Note: visual children must implement mx.core.IUIComponent) i have imported the validator like this... import mx.validators.Validator; and used li...

Flex 3 simple chat: code review request; is it good for a real life application ?

i managed to put together a simple chat using flex 3 / AS3, and i want to know if it is good for a real life application? here is the mxml <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init();"> <mx:Script source="code.as" /> <mx:TitleWindow title=...

Is String.replace any faster than String.split ... String.join in ActionScript 3?

Is it any faster to use myString.replace(/foo/g,"bar") rather than myString.split("foo").join("bar") for long strings in ActionScript 3? Or are they just two comparable methods of achieving the same result? ...

Good Resource for Flash/AS3 Perforamace Tips/Tricks for Games

I'm making a multiplayer flash game that has a lot of graphics/code. I'm having some performance issues with things such as my weather effects. Like I'm wondering if it's better to use a bitmap graphic or just use the "vector" (what ever format flash images are drawn in the fla) graphics in a large resource heavy game? While not wor...

Any Good Actionscript 3 (Flash) 2D Shading "Engine"?

I happen to see a 2D shading "engine" on youtube written for flash and was wondering if anyone happened to know what the most popular 2D Flash AS3 Shading "Engines" are? I'm not real good in this field (which is why I ask encase anyone can point me toward an "easy" solution), Thanks! ...

Preloader size guidelines

Hi guys, I'm working on a high-end flash site (AS3) with lots of video, hi-res graphics, and sound effects; needless to say, the initial preloader's got a lot of work to do (just to get the site to a point where additional assets can be loaded on the fly as needed). Because it'll be displayed for a while on most connection speeds, it's...

Flex 3: Embedding MovieClip Symbol to Image Control programmatically

I've reviewed all the documentation and Google results surrounding this and I think I have everything setup correctly. My problem is that the symbol is not appearing in my app. I have a MovieClip symbol that I've embedded to my Flex Component. I need to create a new Image control for each item from my dataProvider and assign this embedd...

AS3 - multiple level loaded swfs , unloading and assigning xml

I have a Main Document class that instantiates 2 classes that control loading of two navigation grid swfs. These are populated by xml from navigation buttons on the main stage. A 3x3 navigation grid repopulates it's images and links when the buttons on the main stage are clicked Then loads the chosen video when a node on the grid is clic...

Graphic added over button is my blocking MouseEvent why?

Hi everyone my problem today is I have a couple of buttons that slide up and down, when in the up state I add an X graphic to symbolize a a close button. However the X graphic seems to be blocking my button action. I have an example in the movie I've been working on >> here <<. There are 2 movies here, the big one if you click either ...

Are Flex / AS3 metadata tags handled differently at interface definitions than at class definitions?

If I use metadata tags in front of an interface, is that the same as in front of a class? I. e., can I do [Event(name="fooUpdate", type="com.acme.events.FooEvent") public interface IFoozer extends IEventDispatcher { } // ... now omit that metadata in the implementations ... public class Foozer extends EventDispatcher implements IFooze...

To execute Flex cleanup function when browser is closed by user

I have a Flex client application. I need a clean up function to run in Flex when the user closes the browser. I found the following solution on the net, but it only works half-way for me. How could I fix it? Thanks in advance for any responses! Symptoms CustomEvent triggered, but not executed. >> EventHandler for CustomEvent.SEN...

Actionscript 3 modify Label Component text

Hi, I'm trying to modify the text of a Label component that I already placed on the stage in as3. I'm having trouble getting the text to change though, it just stays the same based on the inital text I typed in. I'd like to eventually have the label contents change dynamically. When I compile the swf, the two labels have the original v...

Identify MovieClip in AS3 among DisplayObjectContainer

in ActionScript 3, if I loop through the children of a movie clip, it will return a DisplayObjectContainer, which is a list of DisplayObjects. However, the AS3 typeof cannot identify MovieClip as MovieClip is now an object, instead of a data type. How can I correctly identify MovieClip? I found 3 solutions online: Solution 1 (the sol...

Is there any way to get around a Security Sandbox violation when a swf is loading another swf which loads another swf?

I have a AS3 swf [1] that is loading another AS2 swf [2] which is loading another AS3 swf [3]. I'm getting a Security Sandbox violation on the AS2 swf trying to access the last AS3 swf (3), but I'm using Security.allowDomain("*") in practically all the classes of the first AS3 swf (1). Is there any way to get around this? Thanks. ...

Loop Button with MouseEvent

Currently I only manage to traced the last MC. How could I trace the correct MC properties? private function levelsBG():void { for (var i:Number=0; i<myXML.children().length(); i++) { listText=new TextField ; listMC=new MovieClip ; listText.text=myXML.MEMBER[i].@NAME; listMC.buttonMode=true; listMC.mouseChildren=fa...