actionscript-2

Dynamic alignment in ActionScript 2.0

Hello people, I'd like to be able to press a button and get a set of movie clips arranged in a row, how would I go about this? ...

AS2 to AS3 Migration, Handling code left on buttons

I have several (20-30) Flash files that I need to migrate from AS2 to AS3. The biggest issue that I'm having is that it's extremely tedious to go through all the code and change the places where the code is on the buttons to an event handler model. I'm not hopeful, but I was wondering if anyone knew of any tricks or tools to quickly ch...

Multiple MCs, Single Listener, AsBroadcaster

I'm currently working trying to have multiple MCs inside a container MC which when they mini MCs are clicked will broadcast a message so that I can act upon them. This would be simple in AS 3 as it would be mc.addEventListener(MouseEvent.CLICK, obj); however, this is AS 2 and so I am semi-forced to use the broadcastMessage('myMessage');...

Can an AS2 swf be loaded into an AS3 swf? How can I add this to the stage and interact with it from As3 swf?

I am trying to load a swf written in AS2 into an AS3 swf - using Loader class and listening for Event.COMPLETE. in my onCompleteHandler function i want to add this to the stage so Im trying - addChild(evt.currentTarget.content) ... but I get the following error message: Error #2180: It is illegal to move AVM1 content (AS1 or AS2) to...

Dynamically Loading AS2 file in AS3 - how to tell if the file is AS2

I have a Flash program that loads AS2 and AS3 SWF files dynamically with the same function. I'm trying to convert all the AS2 files to AS3, but I don't have the FLA for some, so they will need to remain AS2. What I need to do is if the file getting loaded is AS3, I need to run an additional set of code to setup some interactive feature...

Can a Flash movie targeted for Flash 8 load in a Flash 10 movie and can the 2 pass variables and call methods?

I have existing flash 8 AS2 work that I want to update to Flash 10. Can I update only those elements i need to be Flash 10 and load them in to the Flash 8 movie as an external swf and pass variables and call methods? Is this a good option and what are the issues to be aware of? Eg will a user with player lower than 10 be able to load the...

Recursively parsing XML in Actionscript 2

I'm looking for an efficient and reusable way to parse xml into an object in actionscript2. The xml structure itself might change so it's important that im able to parse the xml with out 'hard coding' specific nodes, etc. I normally use As3 and wouldn't need something like this since the XML class is easy to drill down into. Below is AS...

ExternalInterface Woes

Hello all. I know there are an abundance of articles and forum post (many of them from myself) regarding ExternalInterface, I guess I'll add one more... I have a small flash app (a button) which is set up to test the availability of ExternalInterface and it works great. I also have a larger, more complex, flash mp3 player, which I am tr...

Avoiding lengthy Flash compilation times when only external Actionscript has changed

I'm working on a large Flash project (.fla filesize is 80MB, and it takes about 4 minutes from ctrl-enter to swf). I'm not working on the Flash side of it, only on some code in my text editor. These incredibly slow compiles are really putting a crimp in my code-test-code cycle. Is there some way to tell Flash "I didn't change anything in...

How do I call a function in an AS2 swf hosted by an AS3 swf and return an array back to AS3 swf? (using SwfBridge)

I have a Flash CS4 AS3 swf (host) that loads a Flash 8 AS2 swf (client) using gSkinner's swfBridge. This works great and the Host can call functions in the client no problem. However I want to be able to call a function in the client and have that function return an array to the host. This is the code I thought would work - Host (AS3...

Referencing movie clip class instances immediately in Actionscript 2

Here's a really frustrating Actionscript 2 problem I have with movie clips associated with classes that are created on the timeline and need to be referenced in code right away: -- I have a movie clip "C" in my library associated with a class "C". -- Class "C" extends MovieClip. -- I have a movie clip on the stage with frame labels "o...

How can an AS3 swf hosting an AS2 swf share the same array?

I have an AS2 swf that has an array that is updated when a user clicks on items on the screen. The array stores the currently selected items. This As2 swf is hosted by an AS3 swf loaded in using Loader class and a local connection between them is managed by swfBridge. I want to know what the best way for both AS3 and AS2 swfs to share ...

What is the best way to handle refreshing a localConnection between AS3 and AS2 swfs using SWFBridge? (load, unload, load again)

I have an AS2 swf that is hosted by an AS3 swf and they connect using SWFBridge. During the course of things i need to unload the AS2 swf and reload it. Therefore I assume I need to re-establish the SWFBridge connection. But when I try to reopen the connection it doesnt appear to work. Heres what I have - AS3 Code: var myBridge:SWFBri...

Passing user-defined types to a child swf in AS2

I have an AS2 swf file which loads a child swf and would like to pass some structured data to the child. I can pass primitive types by just setting properties on the child MC, but complex types lose their values - i.e.: in parent: var testObject = new Object(); testObject.valueName = "value"; child_mc.stringProperty = "test"; child_mc...

Zipping and Unzipping tool for Flash

Are you aware of any zip/unzip component or script for flash / actionscript 2 ? I'm aware of this library for flex / AS3, but is there one for AS2 that will save me a long conversion attempt? Is there such a library that supports creating/parsing password protected zip files? ...

RSS reader in actionscript 2

I'm trying to make an actionscript program that will be able to read an RSS feed and find the title and description of the item. I'm able to load the XML into a variable, but when I try to look at the children nodes of the XML the output tells me there are none. I was able to find a very nice RSS reader explanation made in ActionScript 3...

Flash Bug - Force screen repaint

I have a Flash project that is a little unique in that it's an AS3 project that loads AS2 SWF files. I used the JumpEye bridge to make it all play together, but I'm experiencing a weird bug. The bridge file has two locations to load a SWF file. The main section and the preview section. The first time I load a preview, it loads and cl...

How can I get the width/height of a loaded swf's stage in AS2?

I'm using MovieClipLoader to load an external as2 swf file into my as2 flash project, and I'm having trouble getting the original stage size of the loaded swf. When I run the following code: var popup:MovieClip = _root.createEmptyMovieClip("popup", 1); var loader:MovieClipLoader = new MovieClipLoader(); var loadHandler:Object = new Obj...

How to make SWF Call a Rails Ajax Request?

Hello, I'm writing an application that requires a flv video to be watched before displaying a proceed button to the next section of the site. Currently when the video ends the SWF player makes a POST request to the server marking the video as watched for the current user. Upon success the SWF player calls a Javascript function... Aler...

How to remove XML entity references in Actionscript

I need to remove a bunch of ' from a string that I obtained through an XML document. I'm working with Actionscript 2, so Regex is not an option for me. Even though I'm looking for an Actionscript 2 solution, still reply with an Actionscript 3 answer if you have one for anyone else who might need it. ...