actionscript-3

Actionscript 3.0 String With Format?

How can i format a string with supplied variables in AS3? //vars var myNumber:Number = 12; var myString:String = "Months"; var myObject:MovieClip = year; //string myString.txt = "One (?) consists of (?) consecutive (?)", string(myObject), string(myNumber), myString; so in the string above, i would like myString to display "One year c...

AS3 XML Slideshow Woes

Hello All, I am hoping someone out there can possibly shed some light on a couple issues I am having with an image slideshow I have been working on a simple slideshow for a project and everything was going great/as expected up until I created a function to hide the previous images before displaying the next. On the first pass through e...

Actionscript 3.0 Determining Event Listener Sender?

is it possible to determining what object calls a function based on an event listener? for example, i have 2 buttons on stage that call the same function when they are clicked. i'd like the function to determine which button was the sender. firstButton.addEventListener(MouseEvent.CLICK, myFunction); secondButton.addEventListener(Mouse...

flash.media.Sound not sending HTTP request headers

I am using Flex 3 (ActionScript 3.0). I use the HTTP progressive download to play sound files. I want to secure the sound files, by only serving them when the request comes from my flex app. I chose the simplest solution of adding a HTTP header to each request send from the app. But flash.media.Sound object ignores the headers set in fla...

Duplication of Mediators in Robotlegs AS3 MVCS

I'm using robot legs framework and wondering how mediator.mapView works with multiple instances of the same view. For example, in the following, is a new ItemDisplayMediator created for every ItemDisplay instantiated, or do all ItemDisplay's use the same mediator? If they each instantiate a new mediator, is it possible to use a single me...

Writing to a file in as3 flash develop

Ive been doing some research and I cant seem to find anything on writing to a file. My initial question was writing a array to a seperate file. But now I am looking for resources on how to write any data such as XML or a array to a file. What I want to do is create a game editor. I want to eventually save that data to a file to be opened...

Changing the position of AIR-window (in AS3)?

I created a simple transparent app for Adobe AIR in Flash. It has not chrome, so now I need to make it draggable. How could this be done? Thanks! ...

How is the Actionscript 3.0 sample Maze game's code included?

I can't find the line in the Adobe samples for a maze game where the actual .as code is included into the project. This is fundamental, since my own implementation is just using include "file name";, which isn't working. I also can't use import, since I then can't access the elements placed on the stage. Help, please? The files are avail...

Good resources for learning event driven flash development?

What are good books / site where you can learn the best practices for event driven programming in actionscript (3 obviously). I've got a big project coming up and, to be honest, my flash is usually a big mess of classes and I don't want the the next one to turn into a ball of hair behemoth. ...

AS3 Pass FlashVars to loaded swf

Hi I have a A.swf which loads B.swf onto a movieclip and needs to pass it some FlashVars. When loading B.swf with html, I can pass FlashVars fine. When passing from A.swf, it gets a Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: file: The code in A.swf is var request:URLRequest = new URLRequest ("B.swf"); var...

choose random xml node from xmllist according to a condition

Hello, I'mm using flex builder 3. I have an xml file that looks like this, notice the flag property. It can be either 0 or 1: <question id="2"> <short>OMG</short> <meaning>Oh My God</meaning> <hint>OMG did you hear they broke up?!</hint> <flag>0</flag> </question> <question id="3"> <short>BTW</short> <meaning...

Actionscript 3.0 Tween Error

i'm attempting (so far unsuccessfully) to programatically increase and decrease the scale of an object on stage. there is a Grow button (grow_btn) and a Shrink button (shrink_btn), which increase and decrease the scaleX and scaleY properties of a selected object (either redObject, greenObject or blueObject) over time. the problem i'm...

Bold and regular font in dynamic text under a mask In Flash with AS3

Hi all ! I have this text "my text is <b>bold</b> and regular". I want "<b>bold</b>" to be... well, let's say... bold ! I have a mask layer under which there is a text field. The text field shows htmlText, and i must embed chars. If not embedded, it doesn't display because of the mask. So the solution of importing 2 user fonts ( one ...

[Flex] How to print out an object memory address at runtime? like this.toString() in java.

How to write an AS3 object's memory location for example to a label? I need it for debugging purposed. Thanx ...

Encrypt/Decrypt Image in ActionScript 3

I am developing a mobile app that involves (essentially) picture messaging as a feature. I need the images to be encrypted/decrypted with a simple, plain-text password. Due to the nature of the images being captured, it is /critical/ that the encryption and decryption processes happen on the device. After sitting through a presentation ...

ActionScript 3 - Install a library

I would like to know how can I install a library packages to a Flash project. I am using Adobe Flash CS4 and the library I'm trying to include is in AS3. The library can be found on http://code.google.com/p/as3ansi/ ...

Can JavaScript call ActionScript code?

Hey all.. I'm new to Flash. I have created a flv player that can play videos dynamically based on a user selection in a list component. I would rather not develop the user interface in Flash. Meaning, I'd like to bag the list component. Mostly because I am not very savvy yet. Is it possible to have javascript call actionscript? I would ...

What does the error Client.Data.UnderFlow mean in an AMF transaction?

During RubyAMF and AS3 interaction, I keep getting the error "Client.Data.UnderFlow" in a NetStatusEvent.NET_STATUS on the AS3 side. On the Ruby side I get "ActiveRecord::RecordNotFound (Couldn't find {type} without an ID)", where {type} is the defined type that I'm looking up. A google search suggests that this issue seems to have com...

AS3: How to dispatch event from actionscript class

Hi! I have small chess application which consists of cells and boards. When user moves an item to the board, I want the board cell to dispatch an event so Board can listen to it and call a listener public class BoardCell extends Canvas { public function Sample():void { ....Some code var e:Event = new Event("newMove") ...

How to extend SWFLoader component to "fit" any sized image inside it?

SWFLoader's scaleContent is not able to do what I'm trying to achieve: <mx:SWFLoader id="img" width="600" height="400" scaleContent="true"/> When an image of size 100x80 is loaded inside it, the image does does not resize to 600x400. That's because scaleContent = true. Then, I set maintainAspectRatio = true. The image did resize to ...