actionscript-3

positioning objects relative to MovieClip that has scaleX and scaleY changed

Need some help with a small problem. I'm not too hot on the maths in AS3. I have one Sprite which acts as a container for two other Sprites. One has a picture the other has a series of hotspots. If i change the scaleX and scaleY of the picture, the hotspots don't line up anymore. Do you know the correct equation so that any scale i set ...

[AS3] I have a var in as3 and I want to get its name in a string

Example: public var myVar:Object; // now I want to get the myVar string // myVar is not instanced* public var whatINeedIsThisVar:String = 'myVar'; thanks ...

ASDoc compiling error in Flash Builder 4

I can't seem to figure out why i continue getting this error every-time I try to compile ASDoc in Flash Builder 4. I did succeed in ASDoc creating a asdoc-output folder but it is incomplete. There is only toplevel.xml and a tempdita folder that show up. This is the error that shows up on my Console Error at xsl:choose on line 46 of p...

How to display images from FileReferenceList?

I have a FileReferenceList from which I'd like to display images in a DataGrid; currently I'm getting the following error: Only one download, upload, load or save operation can be active at a time on each FileReference. Following is my code; anyone know how to resolve the error I'm getting? Thanks. Here is my DataGrid: <s:Panel> <mx:D...

Convert a byte array from a C# web service in to a file using AIR 2 (AS3)

I'm using a web service created in C#, its purpose is to get files from a server, and I'm trying to use it in AIR 2 (AS3). Actually I can communicate with the web service with this library: http://labs.alducente.com/gophr/ When I call the webservice function I get this XML: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/en...

In actionscript, how do I write keyboard handler without typing ascii codes in my code?

I am writing a keyboard event handler in actionscript. I would like to trace something when the letter "d" is pressed. private static const THE_LETTER_D:int = 100; private function onKeyUp(evt:KeyboardEvent):void { if (evt.keyCode == THE_LETTER_D ) { trace('Someone pressed the letter d'); } } Is there a way I can do th...

Maintain native size on loaded swf into as3 movie

Hey Guys Anyone know how to maintain the original stage size of a externally loaded swf in as3 FP10?? I can't find any documentation on it and don't want to mask it. Thanks Sam ...

How to create a method that can accept arraylist/collection of object - custom class type in actionscript

Like java, I want to create a method that accepts an array list of particular object type. In java: public void addStudents(List<Student> students) { ... } In actionscript public function addStudents(students:ArrayCollection):void { ..... } Here I want to have public function addStudents(students:ArrayCollection). Thanks ...

Flash AS3: Using "string" to pass in E4X XML querry

I want to be able to do something like var XMLquerry:String = "a1.a2.a3"; var parserVal:XML = parserMethod(XMLquerry); // or var parserVal:XMLList = parserMethod(XMLquerry);` and get an output something like <a3>Some value</a3> Important: And I want to be able to replace the output at a1.a2.a3 so using decedents is out of question...

How to avoid Security Errors when using the Youtube AS3 Player API.

I'm using the Youtube AS3 Player API to load video's in a Flash Project. I get this really annoying Error when loading the Player swf: SecurityError: Error #2047: Security sandbox violation: parent: http://www.degoudenglimlach.be/main.swf cannot access http://www.youtube.com/[[IMPORT]]/s.ytimg.com/yt/swf/watch_as3-vflbgr4dW.swf. I tri...

Symbols/classes for walls and doors

Really basic question here: I'm trying to do a 2D top-down Zelda type game. I have two symbols defined for vertical and horizontal walls, with four instances of each. I also have four symbols defined for north, south, east and west doors, with accompanying classes for all of these symbols. My question is, am I doing this wrong? Can I ge...

AS3 Time offsets "Clumping together" after window switching

Imagine you have 100 tweens. Each tween is simply an element (circle) that goes up, and then comes down again. By delaying each tween a bit from the previous, a sine wave effect is created. Now all this is working fine. The problem arises when you switch to another window or application, and then view the window with animation again. Th...

What benefits will I get by using PureMVC framework for developing a Social game like FarmVille ?

My requirement is to build a social game like FarmVille using LAMP stack. For frontent ActionScript 3 part, I want to consider PureMVC as MVC framework. What are the pros and cons of using PureMVC framework over building the game without framework ? I need to consider following points : 1. Ease of use 2. Utilities and benefits of using ...

Combine 2 dataGrids into one with states

332 <mx:DataGrid id="grid" width="100%" height="100%" sortableColumns="true" itemClick.ordersState="{_selectedOrder=grid.selectedItem.ordersState}" selectable.ordersState="true" includeIn="locationsState, ordersState" > <mx:columns > <mx:DataGridColumn d...

ActionScript - Retrieving Index Of Specific Filter

i have a few filters on a sprite. on mouse over i would like to access one of the filters in the filters array, but i'm having a bit of trouble trying to accomplish this. mySprite.filters = [new DropShadowFilter(), new GlowFilter(), new BlurFilter()]; mySprite.addEventListener(MouseEvent.MOUSE_OVER, mouseOverEventHandler); function mo...

Playing nicely with "for each" in ActionScript?

Lets say I have an ActionScript class: MyClass and that class has data in it. Now, lets say I want to iterate over that data using "for each": var myData:MyClass = new MyClass(); myData.Populate(fromSource); for each(var item in myData) { DoSomethingWith(item); } Of course, this does nothing, because MyClass is a custom class, and...

what are MathJax opensource analogs for ActionScript\MXML developers?

what are MathJax opensource analogs for ActionScript\MXML developers? so to be cqapable to render strings like this J_\alpha(x) = \sum_{m=0}^\infty \frac{(-1)^m}{m! \, \Gamma(m + \alpha + 1)}{\left({\frac{x}{2}}\right)}^{2 m + \alpha} into stuff like this ...

Best practise here with regards to Events

I'm wondering what would be considered best practise for this. It's fairly inconsequential but I'm interested in peoples opinions. We have two classes - TitleBar and TemplateMain. TitleBar is a bar at the top of the screen that displays the project title and several buttons (settings, print, fullscreen, etc) that the TemplateMain will n...

Actionscript: how can I add a custom property to an instance of Image?

var image:Image = new Image(); image.property_1 = "abcdefg"; it can't compile as the Flash builder says: Description Resource Path Location Type 1119: Access of possibly undefined property jdkfjds through a reference with static type mx.controls:Image. adm.mxml /adm/src Line 209 Flex Problem H...

FLASH/AS3: A way to move a MovieClip from one position to another with a bounce effect.

I want to have something like a big still image that you can move by clicking buttons—with a "bouncing" effect. Buttons that moves to an specific position are fine, although additional buttons that allow you to move it freely within a certain restriction is even better. I have an script for it in Actionscript 1.0 I found somewhere eons...