actionscript-2

Flash AS2 - Handle Missing Sound Card

In my AS2 Flash game, I play a number of sound files and wait for the "onSoundComplete" message/function before proceeding. The problem is if there is no sound card in the system (or it is disabled in device manager) - everything acts like it is working (no errors, onLoad handler gets "true") - but the sound never actually gets played...

How to get an FLV to play inside a SWF that is embedded in another SWF?

Yes, it is a strange situation but we have a SWF (with FLA source) that is embedded inside another SWF (no source) by an auto process. The first SWF has a link to a FLV video file. When the SWF with the FLV is embedded it plays but does not show the FLV - just the blinking FLV mime type icon. The problem is that we can embed the FLV bu...

Flash IO error while uploading photo with low uploading internet speed

Actionscript: System.security.allowDomain("http://" + _root.tdomain + "/"); import flash.net.FileReferenceList; import flash.net.FileReference; import flash.external.ExternalInterface; import flash.external.*; /* Main variables */ var session_photos = _root.ph; var how_much_you_can_upload = 0; var selected_photos; // container for sel...

Flash actionscript 2.0 XML parsing works on some nodes, not others

Hi all. I'm working on a simple carousel. My problem appears when trying to insert node values as text in my tooltip sub-elements. Here's my xml: <promotions> <promotion> <visuel>/papyrus/8a8b8d2e26fa35b60126faf90a4d002f-20100223141718.gif</visuel> <remise>55</remise> <libelle>produi...

combobox dropdown problem when load AS2 swf file in Flex

I found the problem about combobox dropdown list in AS2 swf file. My scenario is: There are multiple swf file that was compile from ActionScript2.0 and use Flex to load those swf files in swfLoader component. There are two issue that I found and can't solve it: 1. When I load multiple as2.0 swf file in one flex application the first fi...

How do I allow smoothing in externally loaded images?

In Flash, I can go into the properties of an image in the library and check 'allow smoothing' to enable resampling when the image is scaled or rotated. How can I achieve the same effect for images loaded dynamically by the SWF from an external URL? ...

How to get output of a webpage in ActionScript 2

For Actionscript 2.0 Let's say this page www.example.com/mypage returns some html that I want to parse in Actionscript. How do i call this page from Actionscript while getting back the response in a string variable? ...

MovieClip references going awry in onLoadComplete callback

I'm loading a bunch of images into my AS2 flash movie, and I've encountered some strangeness. Roughly, my code looks like this: function doTheLoading() { m_imageClips = []; for (var i:Number = 0; i < 3; i++) { var imageUrl:String = "http://server/" + i + ".jpg"; var mc :MovieClip = m_mc.createEmptyMovieCl...

How to avoid the annoying new line generated at SendAndLoad();

Hi to all, Please is there any workarround to avoid the new line generated while sending data using SendAndLoad(); in AS2 ? I send "00:00:12:36" But php output: 00 :00 :12:36 Any help?? ...

Actionscript 2.0 element.text always outputs "00"

Hi everybody, I'm fighting against a strange behaviour with my actionscript! After setting the four integer variables from the MovieTimer sprite (hour, minute, second, mili-sec) and concate them i got always double zero: 00 stop (); delete this.onEnterFrame; var str1; var str2; var mili; var second; var minut...

AS2 Increase speed & ease out

I'm creating a thermometer with the mercury animated as donations come in. I haven't touched flash in a long time, so be gentle. How can I change the code below so the animation is faster without increasing the framerate? var maxMercuryHeight = 192; // Mercury height at 100% var currentDonations = 80; // Percentage of donations taken ...

Flash: Am i totally misunderstanding Event Listening?

I don't know why but i am having trouble getting my head round event dispatching. Take this for example. someClass():Void{ this.addEventListener("onChange",someObj); } Am i right in assuming this means that someClass is listening for an onChange event and when it gets it, it is then going to fire the onChange method on someObj?...

Flash: dynamically adding events code to instances possible?

I want to make a movieclip invisible initially but i dont want to set it manually within the properties in flash because i cant then see it on the scene. I was hoping i could add some code like so: MC Frame one. this.onClipEvent(load) { this._alpha = 0; } but I cannot. How can i set the MC _alpha to 0 for all instances without addin...

What is the easiest way to swap items inside an array (Actionscript 2.0)

I have an array that I want to sort based on the value of one of the values in the array. The way I want to sort it is to evenly distribute the value I am searching for throughout the resulting array. For example - Original array = [a,b,c,d,1,2,3,4] I want to achieve - [a,1,b,2,c,3,d,4] I can work out when to insert the numbers (tota...

Why is my sound not working in Flash?

This is what I have as far as code, it is in the first frame of the movie. nature = new Sound(this); nature.attachSound("sound_naturally"); nature.setVolume(50); nature.start(0,0); nature.onSoundComplete = function(){ nature.start(0,0); } trace(nature); The trace outputs '[object Object]' at runtime. I have the sound exporting to...

Clamp MovieClip to only be draggable inside stage?

I have a MovieClip that I want the user to be able to drag inside the stage, but I don't want it to be able to move outside the stage. Currently I'm using this._parent.startDrag(); to allow the MC to be dragged, but I don't know how to stop it from being dragged outside the frame. ...

Macromedia Flash 8 - Ireland Map, on mouseover dublin, dublin expands

Macromedia Flash 8 Question: I have a map of Ireland, just a gif, and there are several small buttons representing various point of interest around Ireland, which are scattered across the map. This part works fine. THE PROBLEM: Dublin is too small to contain all of its points of interest (approx 20). THE SOLUTION OnMouseOver Dublin, I...

Actionscript 2.0 input text properties

I need to set input form properties to max 3 characters and number only. Can't find it in the documentation. ...

Actionscript 2 call function from variable

How can i call a function form a variable. var upfunction = init; //or var upfunction = init(); I have tried the above code and it does not work. I want to be able to call that variable from a keypress and change the variables function. For example. function init(){ //Do whatever } function init2(){ //Do another thing } var u...

MovieClip property - what is the url it goes when I click on it.

I have bought a flash template in an online store. There are different buttons on it and some of them link to existing local html files from the pack - index-1.html, index-2.html etc. There are also some buttons that don't go anywhere right now but they are intended to be linked to some urls too. They react with animation on mouse rollov...