actionscript

Export SWC from Flash and Access Child from Flex

I'm creating an actionscript project in Flex Builder. I succeed to export from Flash a SWC file, and to use it succesfully in Flex. I have a good programming background and Flex looks very simple for me, but I have difficult times in flash. I'm trying to achieve something that might be very simple(not for me of course): I create a simp...

Pass HTML-DOM to Flex's actionscript.

Hi, All i want is to pass a HTML (DOM object) from javascript to Actionscript. i saw this article on the net and tried a similar code. But when i execute the code in IE, it alerts : "Out of memory at line 18". I'm stuck here from yesterday. i'll post the mxml and html here.. The MXML : <?xml version="1.0" encoding="utf-8"?> <mx:...

Flash AS2 Call function from Next Frame

How to call AS2 method from NextFrame(or any other frame) in Flash? Say you have Action Frame on frame 3, and another one on frame 4, how do you call methods on frame 4 when you are on frame 3. ...

actionscript - testing actionscript via command line

Hello, I would like to know if is there any easy way to test actionscript by using some kind of application like ruby's irb or javasctip spidermonkey where you can just open up your terminal and type the code straight away. This would be a good time saver when speaking of actionscript, since to test some syntaxes, classes, etc. you woul...

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...

Is () requested for invoking a Flex ActionScript constructor?

In Flex ActionScript, a new object can be instantiated via the parameterless constructor with or without (). Example: var array:ArrayCollection = new ArrayCollection() or var array:ArrayCollection = new ArrayCollection Is there a difference between the two? Is one preferred over the other? ...

Licensing Scripts

Hi, I've had my first nightmare client recently who was messing me around with payment for a project. So... I've come to an agreement with another client to use some of the sites scripting to build a site for them. But, now the original client wants their site too. I have made a deal to licence the reused parts of the site (some jQuer...

get the value of a textbox from a nested movieclip in flash

I got an fla file with nested movieclips. The "username" text box is present in a movieclip "login" which is included in another movieclip "member". How to access the value of the textbox "username" in actionscript when a button is clicked(on(release) event ). the button is also present in the "login" movieclip ...

Where to register mediator in puremvc ?

Currently I am working on flex using puremvc framework. Actually my question is related to where to register mediator in puremvc framework. One of my colleague is registering mediator in views(components) creationComplete method only (inside view). While my preference is send some notification from creationComplete method which could be...

Flex dynamic form height

I'm not sure if this is possible, is there a way to get the <mx:Form> to set its own height based on the position of an element within it? For example something like this: <mx:Form height="{submitBtn.y + submitBtn.height}"> <mx:FormItem>... </mx:FormItem> <mx:FormItem>... </mx:FormItem> <mx:FormItem>... </mx:FormItem> ...

loading child swf as3

Hi, I've been given an fla to make some changes too. Basically its a fairly long timeline animation with sound. So far I've successfully added a few button functions for sound etc.. but one has got me stumped. One of the buttons needs to load a child swf. I'm using the code below but I'm recieving an error - 'Error #1009: Cannot access...

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...

How to do binding inside htmltext CDATA

I couldn't find a way to bind a variable inside the htmlText property of a Text component i want to be able to do something like this : <mx:Text id="bodyText" styleName="bodyText"> <mx:htmlText > <![CDATA[<img src='assets.OrangeRect' align='left' hspace='0' vspace='4'/> Bonjour {UserData.name} ]]> </mx:htmlText> </mx:Text...

actionscript flex, how to send browser width to the swf itself

I'm working with flex, but actionscript ideas are just as good. The flex <s:Application> tag has height="100%" width="100%" so the swf fits the browser as the browser gets resized. My problem is that I have a <s:Label> that I need to position based on the real/current size of the browser. <s:Application height="100%" width="100%"> ...

Loading of external SWF results in a "Could not find resource bundle messaging" error

I'm using flash.display.Loader to load this example SWF as a use-case for loading SWFs that uses flex charting components in an application I'm working on. This is the code I'm using to load the swf: Main.mxml: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="onCreation...

Flash/ActionScript3 crashes on getPixel/32

Question: The below code crashes flash... Why? The crash causing lines seem to be //var uiColor:uint = bmpd.getPixel(i,j); var uiColor:uint = bmpd.getPixel32(i,j); trace("Color: "+ uiColor); I am trying to take a snapshot of a movieclip and iterate through all pixels in the image and get the pix...

How to process AJAX requests more securely in PHP?

Ok, so I want to send AJAX requests to my website from my Flash games to process data, but I don't want people downloading them, decompiling them, then sending fake requests to be processed, so I'm trying to figure out the most secure way to process in the PHP files. My first idea was to use Apache's built in Authorization module to requ...

Converting mxml Rect & SolidColor to actionscript

I'm trying to learn how to use actionscript over mxml for flexibility. I have this simple block of mxml that I'm trying to convert to actionscript, but I'm stuck half way though <s:Rect id="theRect" x="0" y="50" width="15%" height="15%"> <s:fill> <s:SolidColor color="black" alpha="0.9" /> </s:fill> </s:Rect> I can convert...

Accessing object properties from string representations

In actionscript an object's property can be accesses in this way: object["propertyname"] Is something like this possible in c#, without using reflection? ...

Can I have variable (linear gradient) transparency for a Flex UI Container

Hello, I would like to have a variable transparency for a Flex UI container. The upper half of the container should be completely opaque but the lower part of it should smoothly change from completely opaque to completely transparent. Any ideas how to achieve it? Thanks ...