actionscript

Make an object react to a sound in Flash

Hello! I have a speaker and I need this speaker moves with a sound. I need to simulate the real world speaker vibration generated by the low and mid frequencies. Does not have to be soo realistic what I whant to know is how I can play a sound and get son mumerical value usefull for apply numerical size transformation to the speaker. C...

only plays one key frame

I hope I explain this well. But in my game I have 3 keyframes for my bullet Movieclip. 1 to display its normal state. 2 to show it Blown Up, and 3 to remove it from the stage. A total of 3 frames. When the bullet hits an object, I go to and play the 2nd frame. then when frame 3 hits, I remove it. Here is my code private function blowUp(...

How to change the coordinate origin in Flash's stage with Actionscript?

I think I did this before but can't find the code. Flash as many other graphical frameworks use the top-left corner as the coordinate origin (0,0) because it's how the underlying memory model is by convention. But it would be really simpler for my calculations if the origin was in the center of the stage, because all the game revolve...

Populate a datagrid from a Loop

I'm just starting to learn flex and AS3 I'm trying to get information into a datagrid that originates from a mathmatical formula. For example if I have 100 and I subtract 5 from it and continue to do so until it reaches 0 so my grid would be something like: 100 | -5 95 | -5 90 | -5 ... ... 5 | -5 0 I'm guessing that it needs to do so...

extending AS3's Array access operators to 'wrap' out-of-bound index values

I'd really like to be able to make Flash's array access syntax 'wrap' over the array's bounds. Lengthy explanation - var array:Array = ['a','b','c','d','e','f']; To keep things simple, the first index is 0, and its value is the first letter, 'a'. To get that value, we'd do this - array[0]; // returns 'a' As long as the index you'...

Referencing other movieclips within actionscript class

I have externalized the actionscript code of a movieclip into a separate class files. This movieclip requires references to some other clips on the stage. What I am currently doing to reference those clips is by using Movieclip(this.parent).otherclip but somehow that feels wrong. Is there a better way to pass in the required references ...

How do I create variable paths using e4X?

I need to know how I can parse a variable path in Flex 3 & e4X. For example, I have two XML strings where the name of one element is the only difference. <NameOfRoot> <NameOfChild1> <data>1</data> </NameOfChild1> </NameOfRoot> <NameOfRoot> <NameOfChild2> <data>2</data> </NameOfChild2> </NameOfRoot> Cu...

Is there any Video Gesture actionscript library/api

So I need an open-source Video Gesture actionscript library/api. So we have a web cam... we move a hand and it causes some events... So i need motion detection for navigation API/Lib Where to get it? BTW: i found one but its documentation is... poor - http://www.elctech.com/demos/using-haar-cascades-and-opencv-in-as3 ...

Best Practice for Transitioning From Nested State to Nested State (see diagram)

I am trying to wrap my mind around the best way to implement nested state transitions in a single threaded programming language (Actionscript). Say I have a structure like this behavior tree: Now imagine that each leaf node is a destination point on a website, like an image in a gallery, or a comment nested in a post view nested in a ...

testing flash movies performance agaisnt range or computers and browsers

I am half way done with making my first flash web game. I put alot of work into it and dont really know how great the performance will be on browsers and range of different types of computers. This is my first time working with flash in general. I was wondering if there is any tools to test my game out against browsers and hardware. The ...

Parse XML in Actionscript

Hi, I need to parse an XML like this: <?xml version='1.0' encoding='UTF-8' standalone='yes'?> <pictures> <pic> <name>clouds1</name> <file>clouds1.jpg</file> <date>20/12/09</date> </pic> <pic>..........</pic> .... </pictures> using ActionScript. I have this: constructor{ var loader = ne...

How do I filter out secific nodes of XML?

Take this XML example: <root> <grandParent GPid="1" hidden="false"> <parent Pid="1" hidden="false"> <child Cid="1" hidden="false"/> <child Cid="2" hidden="true"/> </parent> <parent Pid="2" hidden="false"> <child Cid="3" hidden="false"/> <child Cid="4" hidden="false"/> </parent> </grandParent> ...

overriding a function that hasan optional parameter in ActionScript / Flex

I'm using FlashBuilder 4 beta2. My base class has a function foo(): protected function foo(s:String, z:String=null): void{} Literally "foo" so that there's no chance I'm stepping on a built-in method. I am getting an "Incompatible override" error when attempting to override the method in a subclass: override protected function foo(s:...

how big is too big for a swf file

I am making a flash game. And I want to know how big is too big for a swf file. Also, Ive been looking at my swf file and right now its at 38.2k. Is the swf file that gets created during debugging, is this the correct size for the file that will eventually be placed on the web. thanks ...

Working on a Global Search tool - Just like on MAC

Hi I am working on a search tool for my website in Flex. I want it to work exactly like the "Spotlight" tool on MAC desktop. "http://www.recipester.org/images/6/66/How_to_Use_Spotlight_to_Search_on_Mac_OS_X_42.png" The link is to an image of spotlight. I want to create almost the same thing in FLEX. What I currently have is a "Autoco...

keep image inside a frame

Hi can anyone help me with a problem please. I am not looking for anybody to write code for me but just give me a few pointers. I want to to put a frame or border around an image in actionscript3. I want to use an image that is considerably bigger than the border. the effect would be that the image would move around but only show what i...

1136: Incorrect number of arguments. Expected 0.

I ask this question time and time again and havnt got an answer. Its driving me crazy evertytime I get it. Sometimes it works, and sometimes it doesnt. When I pass a object through the constructor, it gives me the error message. So I always got to make a second method to get it to work. Here is my code if anyone can please help me var d...

Select all MovieClips instances with code

Hi Supose I have a MovieClip called Egg and I have a lot of Egg instances with unique names (required) or without names. What if I need to write a code who break all these eggs refering to the Main object in Library? Instead to add code for every egg with every name in the Stage. This is possible? Thanks ...

Simultaneous Flex Web Service Calls to SAP

I am working on a Flex application that uses ActionScript to make web service calls to SAP. I have generated ActionScript proxy classes, and have event listeners waiting for the service to return a result. This works fine when I call only one webservice. However, when two webservices are called, one of them either does not return any res...

flash editor slows down more code I write

I have flash cs4 and when I am typing code in the editor. It appears that the more code I add to my .as document, the more sluggish it gets. When typing, it appears to be a delay for when my text actually appears on screen. does anyone know what this could be. My computer is not even a year old. ...