actionscript-3

ordering of EnterFrame events

If I have added Event.ENTER_FRAME listeners to different components, how can I set or know the ordering of when these events will be fired on each enterFrame? Instead of adding enterFrame listeners to individual elements, is it better practice to have one element which listens for enterFrame events, and has an array of elements needin...

Finding Something lighter than Sprites!!

I am making a Sim City like game. There are lots of tiles. When I first started. I was just using a tilesheet. I was copying the necessary pieaces from the tilesheet. on to a blank bitMapData. I then took the bitMapData and put it into a bitMap which I then put into a DisplayObject. It worked great! tileSheet:BitMapData <----- data i...

Extending BitMap class. will addChild() accept subClasses ??

I want to create a class that is interactive and can hold an image. I want it to be lighter then the Sprite class, so I was thinking about extending the bitMap class. If I extend the BitMap class. put a bitMap data in that class and at it to the stage. would it appear ??? ...

Polarized shift of percentage values

Hi I have this in AS3 differencePercentage = Math.round(((Pay.init / Pay.current) * 100) - 100); and that gives me the difference in percent between initial and current pay, but it's reversed. When it's positive i.e. pay is above the initial value it says -X%, and when it's below it says X%. Is there any obvious way I'm not seeing to...

BitMap Eventlistener not working

I am trying to add an event listener to my BitMap. Tile extends gameProps, which extends BitMap. I try using addEventListener. That doesnt work. but the Adobe docs say that Bitmap has an addEventListener object. package { import flash.display.BitmapData; import flash.events.*; import flash.events.Mou...

HttpService question

Hi, I'm a flex noob and I have a few doubts regarding the Httpservice class, Can I use it to fetch data from a file that resides in my own server or can I use it to download any url like external sites like google or stackoverflow (even ones without an api)? Does httpservice behave differently based on whether it is an desktop app or...

Flash AS3 Game - high score with graphics not with text

Hello, is it possible to use graphics (the numbers 0-9 in one png-file) instead of a Textfield to show the high score of a game to the player? With a TextField it is easy to "refresh" the score but what can I do, if I want to use my png-files for the score? Is there a simple way to do this? How are other flash game designer do it? My cu...

Help with understanding usage of Value Objects in Flex

Hello! I have some small problem in understanding Value Objects in Flex... I'm trying to get some data from PHP/MySQL and send it to Flex but I'm stuck in some (obviously) basic problems... Let's say That my object in Flex would look like this: package some.package.VO { [RemoteClass(alias="VOPerson")] [Bindable] public...

Converting microphone data into AMR

It is possible to convert microphone data into AMR based data? ...

How to know if a TextInput component is active in Flex

Imagine I have two TextInput components. How do I know which one is active, if any? Is there an event or a property that tells me that? ...

Http DataInfo used with resultHandler ...

Hi there, I use this resultHandler and instead of using my data with four(4) separate field I would like to use the following code in one field. and as a one line read out? E.g (title + "." +firstName + " " + middleName + " " + last Name) = (Mr. Harald E. W. Buttweiser). I get it with static Xml e.g. models but cant find the right way ...

AS3: Event dispatching via dispatchEvent- pass params?

Hi there, I would like to dispatch an event from my class along with a url. I know that I can do the following: import flash.events.EventDispatcher; private function thumbClick(e:MouseEvent):void { dispatchEvent(new Event("clicked")); } But I don't know how I would send params along with the event...? Also, in my main app runne...

AS3: Loading bytes from multiple sources

Hello, I am loading multiple images into a class instance and I would like to keep track of how large the complete amount of loaded data is at any given point. I have grabbed the totalbytes from my directory of images via a PHP script... but collecting the new bytes from the ProgressEvent on each image seems tricky for some reason. Let'...

How do I dispatch custom events from a created class?

I have an <mx:Application> which contains a <mx:Module>. This module has several child modules. It also has some an instance of a class I have created. I am trying to have a method of this class dispatch an event that can be "heard" by the module and handled. This isn't happening. Any ideas? To be more clear, I am using 'dispatchEvent...

Quadtree detects collision inaccurately

Hi, I am trying to implement a quadtree of rectangles (instead of points) to be used for collision detection. For some reason, overlap/intersection/collision is not always detected. I suspect this has something to do with the way an inserted collider looks for nearby colliders (see the "COLLISION A" and "COLLISION B" sections of Quadtr...

Transparent jpeg images in Flash AS3

Hi can anyone offer some help please ? I have two images on my flash stage (A camera image and a scenery image) The idea is that the camera is in front of the scenery. The problem is although both images are on my stage the camera is completely transparent and looks wrong . How can I set the cannon image transparency so that it is a sol...

circular colorTransform

Is there a way to apply a colorTransform to a BitmapData in a circle rather than in a rectangle? Instead of erasing rectangular parts of an image by reducing the alpha channel as in the code below, I'd like to do it in circles. _bitmap.colorTransform(new Rectangle(mouseX-d/2, mouseY-d/2, d, d), new ColorTransform(1, 1, 1, .5, 0, 0, 0...

How to adjust flash objects from all keyframes

I know there has to be away to adjust objects on the stage from all keyframes because it's probably the most annoying thing I've experienced I adjust a bitmap image and then when you play the movieclip, right when it hits another keyframe it shows the old position instead of the new. How can I update all images on the stage including al...

What is the benefit of using Flex?

Since Flex generates Actionscript. Why not use Actionscript at all ?! sorry, i'm just curious . ...

Convert powerpoint to flash

How hard is it to import a powerpoint presentation into flash. It would be perfect for me if the output would look like this: every powerpoint slide becomes a movieclip or a .swf file. I don't have any animations and sounds, its just text and images. I know i could save the slides to png but its very bad idea using bitmaps for text in fl...