actionscript-3

Getting Better at FlashDevelop

Hey guys, I have been programming with as3 for the past 4 months and Ive been getting rather good at it. I just recently decided to work with flashdevelop. I notice that there is alot of code that is availible in the flex sdk that isn't available in as3 with flash cs4. Like embedding of assets and such. I've been trying to find some up t...

AS3 Scope issue, How do I dynamically create a new MC in a package/class?

Hello all, Thanks very much for your time! Here is my question,... public function addNewMc():void{ var newMC:MovieClip= new MovieClip(); this.addChild(newMC); } public function removeOldMc(newMC):void{ this.removeChild(newMC); } How can I create a new MovieClip within a method, which can be used throughout the class, with...

Flex, xml and E4x

Hi I have a basic question. I am loading an XML file using the URLLoader and putting it into an XML variable. My question is, can i leverage E4x to go through this xml data. I tried doing for each (var grid in xmlData.grid){ output.text=grid.name; } But it says that variable 'grid' has no type declaration. This ...

problem binding inside itemRender

ok guy I really need you super brain on this, I had pull out all my hair now, I just want to throw the towel on this one, ok, I have an itemrender component, which you can see below <?xml version="1.0" encoding="utf-8"?> <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" horizontalScrollPolicy="off" creationComplete="hbo...

Can't embed XML in FlashDevelop

I am trying to embed some xml into my application but I get the following error Fault] exception, information=TypeError: Error #1090: XML parser failure: element is malformed. Here is my code. package { import com.objects.EngineApi; import com.objects.Rectangles; import flash.display.Sprite; import flash.events.Even...

fix needed for bug in TextField/Text

Sort of a complicated scenario - just curious if anyone else could come up with something: I have a Text control and when I scroll it and stop the scroll with the cursor over some text that has a url, the cursor doesn't revert to a hand, and also flash player starts acting as if a selection is being made from the last cursor position. ...

Flash Media Server & NetStream Random Publish Delay

I am trying to build a karaoke system in Flash. However, I've run into a problem with synchronizing the base and loop track because of a random delay in NetConnection.publish(). To test this I play a video and publish a recording at the same time with the headphone jack going into my line-in jack. I would expect there to be a small but ...

Flash Actionscript 3 not accepting compile-time constant

Question: I get an annoying error: I try to use the type Size in the below actionscript code. But I always get this error: 1046: Type was not found or was not a compile-time constant: Size. But no matter what I try, it seems to break when I add public function get Size():Size Somehow it doesn't like the return type Size, but what am ...

Custom button with image

Hi i'm trying to create a button in actionscript 3 that will be made by a custom image ( a car.jpg from my HDD ). Is it possible to do that with SimpleButton class ( i mean is there a way to load the image and attach it to the button ?) or is there another way? If i would like to have animation also in the button when let's say i roll o...

Flash XML socket choking

I'm trying to work out some kinks in a multitouch application I've built. It uses flosc to communicate with a xml socket server that sends the multitouch events. This all works fine and dandy for most of the time. But if I'm mean and flood it with multitouch events Flash can't keep up with parsing the input, and the socket just keeps...

calling super() from an actionscript constructor with varargs

If a constructor takes its parameters as a vararg (...) it seems to be impossible to create a subclass that will just pass on that vararg to the superclass. There is a related question with fix for this same situation for normal functions: Wrapping a Vararg Method in ActionScipt but I cannot get that to work with a super call. base cla...

AS3/Flash: Why moving a symbol's class file from a top-level directory to a deeper directory break the link between symbol and class file?

:: EDIT :: This question is a little sprawling, so I'm trimming it down to make it more concise. SUMMARY: When I have a class linked to a MovieClip in my library and that class takes an argument in its constructor method. That class will compile properly ONLY when it's located in my top-level directory (same dir as the .fla and Docume...

bizarre event behaviour in flash AS3

This is the strangest most unexplainable and frustratng thing I've experienced with flash and I have no Idea how to solve the problem. Consider this function public function trackDownloadHandler(event:MP3DownloadEvent):void { dispatchEvent(event); //dispatchEvent(new MP3DownloadEvent(MP3DownloadEvent.OPEN,event.channelPadID)) ...

Flex Tree not re-expanding

I have a tree control and after I drop an item in it (which updates the dataprovider) I want it to stay open. I've tried a lot of things including the example at this question which I couldn't get to work so I'm doing something I feel is even more basic. Like this: [Bindable] public var open:Object = new Object(); private function drop...

Plain text from PDF using Air/ActionScript

Is there a way to extract plain text from a PDF file using ActionScript? If not, can you give me some hints on how it is implemented elsewhere? ...

Changing SimpleButton.y does not appear to move the hitArea of the button

UPDATE: This is not an actual issue. It transpires that there was another Sprite being create and set to alpha=0 which just happend to be at the same Y position as the height of the SimpleButton. This was preventing interaction with the button. Thanks to the guys for your thoughts. I'm closing the question. I have a SimpleButton which...

Count with decimal place "dynamic text" AS3

This is my 2-part question. My understanding is small so "beer" with me. This example counts from 1-100. I want the decimal keep counting to ten over-and over. (a.)How do I loop the decimal? 1-10 over-and-over. (b.)How to I get the whole and decimal value on the same dynamic text field? THING "It's a counter with whole and decimal v...

Changing 'top' property at runtime in Flex.

In the follow Canvas, how do I change the property top at runtime? <canvas top="10"/> I tried: <canvas top="{ topVariable }"/> But the binding doesn't seem to take effect. How can this be achieved? ...

Can I send commands to operative system from Adobe AIR Desktop Application?

In Python there is a function: os.system(command) that runs the command passed by parameter in the command line, there is something similar in AS3 (or MXML) running an Adobe AIR Desktop Application? ...

Clever data structure to represent layered circle.

I'm making a game and I need to represent a "layered" circle in some clever datastructure. A circle can have any number of layers. Each layer has a number of "slices", they can be of different lengths and pieces can be missing. The innermost layer is always a full circle. Each segment has a color, multiple segments with the same color c...