actionscript

Using Eclipse Templates for Actionscript

One of my favorite features in Eclipse is the templates in PDT. In case you don't know what they are, think of writing "function" and having Eclipse write all the syntactical features and let you jump from variable to variable with a tap of the tab key. So I'm starting to do write AS3 in Eclipse and I miss having the templates at my fing...

Eval formula in AS3?

I'm playing around a bit with ActionScript. What I want is that I can display a mathematical function from a string. E.g. in my working python script I do something like that: formula = 'x**2 + 3*x' for x in range( 0, 100 ): y = eval( formula ) graph.display( x, y ) I want to port this to ActionScript, but it seems like ther...

Animate onRollover onRollout with TweenMax

I'm using TweenMax to animate some arrows to move when I roll over a link, and the animate back, when I roll out. But it's not working, it animates on rollover, but not rollout. function boxLink(mc_function:MovieClip, mc_target:MovieClip) { mc_function.onRollOver = function() { var myTween:TweenMax = new TweenMax(mc_target,0.5,{_x:"2",...

Change color of a dynamic textfield problem

I have this code that should change the color of a dynamic textfield when I rollover the link movieclip, and then back when I rollout. I get no compiler error, it just doesn't work. function textColor(mc_function:MovieClip, tf_text:TextField) { mc_function.onRollOver = function() { tf_text.textColor = 0x7cb0b7; }; mc_function.onRollOu...

Embed characters in multiple dynamic textfields

How can I embed some characters one time, and have them embedded in all my dynamic textfields? ...

Pass strings to function in a loop

I have this code that activates when rollover, rollout, and release. I functions for rollover and rollout works, but the release function does not. I'm trying to pass some strings with url's to the function within a loop. var url1:String = "http://www.google.com"; var url2:String = "http://www.google.com"; var url3:String = "http://www....

Detecting CTRL+V using AS3 in IE

I am not able to detect the keyboard event CTRL+V on a swf using AS3 in IE. It seems to trigger the default browser behavior, and im not able to do anything... Any workaround for this? ...

javascript to actionscript keypress passing utility?

Is there an existing javascript library for relaying key press events in the browser (or certain divs) into flash? I am hoping there might be a library kind of like this one for mousewheel events ? Something like this handles javascript keyboard shortcuts great. I suppose I could just listen for those events and pass the ones I want i...

Removing items from data bound array

How do I remove an items from a data bound array? My code follows. for(var i = 0; i < listBox.selectedIndices.length; i++) { var toRemove = listFiles.selectedIndices[i]; dataArray.splice(toRemove, 1); } Thanks in advance! Edit Here is my swf. The Add Photos works except when you remove items. http://www.3rdshooter.com/Content/Fla...

calling a Flash ExternalInterface with JavaScript

I'm trying to call a function declared with ExternalInterface in a Flash swf, using JavaScript. It worked once, but all of a sudden, it stopped working. I have a debug version of the Flash Player, but no errors occur in Flash. Not even a "Security Sandbox Error" or something. The only error I get is the following error in JavaScript Er...

Open source actionscript/flash audio editor

I am looking for an open source browser based audio editor which shows a waveform and let me clip audio. Does anyone know of one? ...

how to read a global javascript variable from actionscript

Given that there is a global javascript variable on my web page named myVar, how can I access the value of the variable myVar from within my flash movie using javascript? I see plenty of examples of using external interface in order to execute javascript from actionscript, but I am unable to find examples of returning values back into t...

For loop with onRollOver problem

Hi, I can't get this For loop with onRollOver to work. for (var i:Number = 1; i<=4; i++) { this['videobutton'+i].onRollOver = function() { trace(i); this['stream'+i].pause(false); this['video'+i].attachVideo(this['stream'+i]); fadeIn(this['video'+i]); }; } It think it has to do with variable scope and the i, but I don'...

Flex 3 - Multiple WSDL, but same service

Hi. I am trying to deploy an AIR application. I have a WSDL located on the server, but I don't always want to use this. For development and for some clients, I want it to use a localhost wsdl. But only if the localhost has a valid WSDL. How do I go about checking for the localhost and how do I build the calls to the service? I don't want...

How do you load a bitmap file into a BitmapData object?

In Flash, the BitmapData object can be used to store bitmaps in RAM, you can later draw them to a MovieClip using the beginBitmapFill() method. How do you load an external bitmap file (.jpg) into a BitmapData object? Even AS3 code would be helpful. Thanks. ...

AS2 FLA Component with embeded classes

I'm trying to create an AS2 component which is easily skinnable. I create an FLA component by creating a mc with some assets > component definition > link it to MyClass, and drop the fla into the Components dir. If I then drag the component into a new fla and try to render, it obviously throws the error that it can't find MyClass. I'd...

how to change javascript function to ActionScript 3?

anybody can help me to change that javascript function to AS3? thanks :) function parseURLtoVars(strLocation){ var rArray = new Array(); var key; var urlString = new String(strLocation); if (urlString.search(/\?/)>-1){ var qArray = urlString.split('?')[1].split('&'); if (qArray.length > 0){ for (key in qArray){...

Using RSLs with Adobe AIR

Does anyone know how exactly RSLs work with AIR? I have a terminal server that runs several instances of a very large AIR application, which unfortunately has 100M RAM on startup and 200 after a bit of use. This is obviously not really workable, and I'm thinking that RSLs may be a solution if they're cached on the machine. However I have...

Synchronous calls using RemoteObject

Is there a way to make synchronous calls using RemoteObject in Flex? Solution: Add the second call to the result handler of the first call, having a token check for multiple originating calls. ...

can an actionscript function find out its own name?

given the following function A(b:Function) { } If function A(), can we determine the name of the function being passed in as parameter 'b' ? Does the answer differ for AS2 and AS3 ? ...