actionscript-3

Flex Error:- 1151: A conflict exists with definition obj_inst1 in namespace internal.

I have wrote a function like , private function addSelectedFunc():void { /** * Adds newly selected privilegs to assignedPrivileges */ var obj_inst1:Array = obj_inst.selectedItems; for each(var obj_inst1:Object in obj_inst1) { objInstance1Array.addItem(obj_inste); } } <ov:HPList id="obj_inst" ...

Flex: Constant strings in metadata

I have something like public class Controller { [Observer("fetchEmployeesEvent")] public function fetchEmployees() : void { //doSomething } } and I want something like public class Controller { public static const FETCH_EMPLOYEES_EVENT : String = "fetchEmployeesEvent"; [Observer(FETCH_EMPLOYEES_EVENT)] ...

Flex 4: Traversing the Stage More Easily

The following is a MXML Module I am producing in Flex 4: <?xml version="1.0" encoding="utf-8"?> <mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="init()" layout="absolute" width="100%" h...

Min. Flex Module size is ~30kb and contains Framework classes. How to remove them?

Compile the following module with all framework SWC-s excluded in release mode in Flex 4: <mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"/> The SWF size will be 35,658 bytes. Now generate link report via -link-report for this SWF and load it...

As3 City Simulation Game Engine

I am planning to create a Flash AS3 game that is like SimCity. Or something like the Facebook game Youtopia. http://apps.facebook.com/you-topia/ Any good AS3 game engines?? I do not plan to create multiplayer games, just single player ones, and the player can load and save the city. The player has to meet a certain objective within a ti...

Adobe air... launch website but pick which browser?

OK I know that in Adobe Air you can call navigateToURL(new URLRequest(url)) and it will open the users default web browser to open the page. Also now in AIR 2 you can launch any application. So I am wondering if there is a way I can launch a particular browser to open a page in? ...

"Make" system for Actionscript?

In working on larger Actionscript/Flash projects, I've started to really feel the need for some kind of "make" system, but I haven't found it yet. Does anyone know if it exists? Required features: Ability to associate SWCs with their source code and/or FLAs i.e. "this swc is compiled from this source" Ability to mark my current projec...

AS3: resizing as a result of an eventListener

Hi everyone, I have coded a map that when a province object is clicked on, it should move to the center of the screen and grow a percentage of the width, along with displaying a number of different things. The problem is that in order for the image to resize it needs to be clicked on twice. It moves, and all of the children display jus...

Phantom class definitions in Flash CS5?

I'm trying to get FlashPunk working in the Flash CS5 IDE (don't ask), and I'm having trouble getting it to compile. In strict mode, the error I'm getting is: net/flashpunk/FP.as, Line 95 1119: Access of possibly undefined property _inherit through a reference with static type World. Typically, this means that there is a missing varia...

flash cs4 file reference. Event.COMPLETE not called on a MAC,

Hi, I am working with a fileReference, however I'm having issues running on Safari on a MAC... EDIT The below example also doesnt work on Safari on a MAC... http://www.permadi.com/blog/2010/06/flash-as3-using-filereference-to-load-files-example-for-flash-cs4-and-above/ # The workflow on a PC runs as such: 1) Create file reference ...

Search BitmapData object for matching pixel values from another Bitmap.

Using Actionscript 3 is there a way to search one bitmap for the coordinates matching pixels of another bitmap? http://dl.dropbox.com/u/1914/wired.png Somehow you would have to loop through the bigger bitmap to find and the the pixel range that matches and return those coordinates. For example the Bitmap with the "E" is 250 pixels over...

flash as3, Error #1009

I'm making a website that exist out of linked pages. All the pages are on the time line and all the code is in an as3 file. The first page with links works but if I want to place a link on the second frame I get the 1009 error Cannot access a property or method of a null object reference. Because the link doesn't exist on the first frame...

Is there a function to test if a String variable is a number value?

Is there a way to test a string, such as the one below to see if it's an actual number value? var theStr:String = '05'; I want to differentiate between the string value above and one such as this: var theStr2:String = 'asdfl'; Thanks! ...

Copy XML Nodes to ActionScript Object Dynamically

Given a very basic xml structure and a generic Object declaration with a property already defined (location), how can I add the nodes of the xml structure (id & name) to the object's properties without statically referencing the names of the nodes? XML: <record> <id><![CDATA[SS001]]></id> <name><![CDATA[SubstationName]]></name>...

swf to image on the website??

hi, i want to convert a swf to image on my website. a user makes some changes on the stage and if he press a button "get image link", the swf stage will be converted to an image and its image link will appear within a box. like imageshack.. so user can use it in forums as image. how can i do this? i even dont know it is about flash or ht...

casting between sibling classes, AS3

I have two classes, derivedClassA and derivedClassB which both extend parentClass I'm declaring var o:parentClass and then, depending on what's going on, I want to cast o as either being of type derivedClassA or derivedClassB. Essentially, this: var o:parentClass ... if(shouldUseA) o = new derivedClassA(); else o ...

Clearing eventListeners on a FileReference object

Hello all, I have a strange issue! I am trying to remove an event listener on a FileReference object by calling a function, but it seems not to be removed, and I do not understand why. Here is the code: private function clearFileUploadListeners(file:FileReference, index:String):void { var dispatchEvent:Function = function(event:Ev...

How to check for and remove a newline (\n) in the first line of a text field in actionscript?

In the script, sometimes a newline is added in the beginning of the text field (am using a textArea in adobe flex 3), and later on that newline might need to be removed (after other text has been added). I was wondering how to check if there is a newline at the beginning of the text field and then how to remove it. Thanks in advance. ...

Selecting MXML siblings with actionscript, like javascript?

I'm trying to get the sibling of an mxml tag similar to the way siblings are selected in javascript. Is this possible in Actionscript? For example, when I click the TextArea with id textarea1, I need it to tell me that the sibling has an id of rect1 so I can do further processing to it. <s:Group> <s:TextArea id="textarea1" click=...

Selecting id of TextArea (despite RichEditableText)

I'm trying to select the id of a textArea when it's focused in <s:TextArea id="textarea1" focusIn="selectId(event)" /> selectId(event){ event.target.id; } Problem is TextArea is made up of RichEditableText so target doesn't actually refer to TextArea. I've tried event.target.parent.id but still not getting there. Anyone knows how ...