actionscript-3

Zooming an object based on mouse position

Hi, I've got a large large Sprite, and I want to zoom in and out keeping mouse position as the pivot point, exactly how google maps or the photoshop zoom works, when you rotate the mouse wheel. To archieve the zoom effect I tween the scaleX and scaleY properties, but the fixed point is (0,0), while i need to be the mouse position (that ...

AS3 - Is it possible to search an Array by Object properties?

Would it be possible to use Array.indexOf() to search through an Array by the properties of the Objects within the array: var myArray:Array = new Array(); var myMovieClip = new MovieClip(); myMovieClip.name = "foo"; myArray.push(myMovieClip); myArray.indexOf(MovieClip.name == "foo"); //0 OR myArray.indexOf(myMovieClip.name == "foo"...

Create XMLfile and save to directory And Update and Delete particular node.

Hi, I need to create a xml file and save in my project directory, add a node to that file, find and update or delete a particular node. I need sample code for this..pls help me to overcome from this . Thanks in advance. ...

Fixing broken paths in ASDoc?

This question concerns using ASDoc to create documentation from AS3. I'm not doing this from Flex or anything, just using the command line, and though everything works fine and ASDoc doesn't return any errors, some of the links in the resulting documentation are broken. Specifically, in all the places where there are links to properties...

Flash 10: How to stream data to a local file?

I need something like FileStream class in Adobe AIR, but needs to work in Flash Player. I know there is FileReference#save(), but it can only save the whole file at once, which does not work if the size of the data to be saved is larger than the available memory... Is it really not possible to stream data to a local file to avoid keeping...

Flash Bug - Force screen repaint

I have a Flash project that is a little unique in that it's an AS3 project that loads AS2 SWF files. I used the JumpEye bridge to make it all play together, but I'm experiencing a weird bug. The bridge file has two locations to load a SWF file. The main section and the preview section. The first time I load a preview, it loads and cl...

React to change on a static property

I'm re-writing an MXML item renderer in pure AS. A problem I can't seem to get past is how to have each item renderer react to a change on a static property on the item renderer class. In the MXML version, I have the following binding set up on the item renderer: instanceProperty={callInstanceFunction(ItemRenderer.staticProperty)} Wha...

Using FlashVars with Flex 3

I'm trying to pass parameters from HTML-land to Flex-3 Flash-land, and can't seem to get it to work. Here's what I've got (basically the default template, modified with FlashVars): <noscript> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="${application}" width="${width}" height="${height}" codebase="http://fpdownlo...

Why is my override protected function createChildren being ignored?

Here is the error: TypeError: Error #1009: Cannot access a property or method of a null object reference. at view::ScoreBoard/setChipCount()[C:\Flex Builder 3\StackOverflowQuestion\src\view\ScoreBoard.as:32] at model::MainDeckScoreBoard()[C:\Flex Builder 3\StackOverflowQuestion\src\model\MainDeckScoreBoard.as:21] ...

FlashDevelop Application not found when build

How do I have to configure my project to open the generated swf file in the debug flash player? When I hit f5 FlashDevelop tells me the following INITIALIZING: Adobe Flex Compiler SHell (fcsh) Starting new compile. Loading configuration file D:\Programmierung\Flex\flex_sdk_3\frameworks\flex-config.xml Loading configuration file D:\Progr...

How to remove child(Movieclip) and add to new parent (Movieclip)

Hi, I need to remove the child(movieClip) from the parent(movieClip) while dragging and add the same child(movieClip) to another movieclip when dropped. this method is used for dragging function pickUp(event:MouseEvent):void { event.target.startDrag(); } when i drop it function dropIt(event:MouseEvent):void { event.target...

Is it possible to create a MovieClip using ActionScript 3 code or MXML?

I'm using the Flex 3 SDK and the free FlashDevelop IDE. As I don't have FlexBuilder or Flash CS4 Professional I cannot make MovieClips graphically. So instead I want to create a simple MovieClip using code or MXML. For example, lets say I want to create a MovieClip with 3 frames, and load a bitmap into each frame to create a simple ani...

Is it possible to get a custom ItemRenderer to scroll the DataGrid rather than its cell?

I'm having an issue with a custom ItemRenderer I've written for a DataGrid. With this ItemRenderer, it's possible that the contents could exceed the width and height of the DataGrid cell - and when this happens, scroll bars appear, letting me scroll the individual cell. What I would like, however, is that when the contents of the cell a...

How can I 'force download' a file that has been generated entirely in Flash?

If I'm generating a binary file inside Flash Player, how do I pop up a 'Save' dialog for the file without sending it up the the server first? I'm sure I heard this was a new feature in Flash 10. Cheers, James ...

Flash player 10 - full screen mode and keyboard

I am writing Flash app (Flash Player 10, AS 3.0) that is full screen capable. I got that part sorted (allowFullscreen=true, stage.displayState). I would like to give users ability to tab through the items there and activate them using space (MouseEvent.CLICK ;-). I know that any keyboard actions are blocked in full screen mode. This Ado...

NetStream Loading ID3 information from stream in FMS

I've been following the basic FMS instructions to load an mp3 and play it. This is working very well. I've also got a second NetStream instance (id3Stream) that should load the ID3 data from the same mp3, but all I get is a StreamNotFound error. Why would the mp3 stream and play but the id3 data be "not found"? Any help would be apprecia...

How to queue multiple events to a single eventHandler in actionscript 3?

Hi, I am building a framework for loading minigames (in swf), and am running into a problem. I currently have a listener that listens for events that the child minigame sends to the parent framework. However, if the child sends two messages (events) too close to each other, it seems that the first event simply get ignored, which causes...

How to remove XML entity references in Actionscript

I need to remove a bunch of &apos; from a string that I obtained through an XML document. I'm working with Actionscript 2, so Regex is not an option for me. Even though I'm looking for an Actionscript 2 solution, still reply with an Actionscript 3 answer if you have one for anyone else who might need it. ...

Saving XML file in AS3 is possible

Hi, var xml:XML = ; I need to save as xml file in local harddisk(project directory). Is it possible to save in as3 itself. ? ...

How to save the file to a Local Directory

hi, I need to save the file in the particular directory. i tried with the below code its working. but its opening the dialog box to choose the path wher the file to be saved. var texT:String="Hi this to be saved"; var file:FileReference = new FileReference(); file.save(texT,"myfile12.Text"); But i need to save the file like this...