actionscript

2 objects following each other but distance pulls them apart

Basically I am making a game where the enemy comes after the hero when He is in sight. What I do to achieve this is var distx = hero.px - px; var disty = hero.py - py; moveX += distx * .00005; moveY += disty * .00005; Now I had to multiply it by .00005 because anything higher, makes him come up on the hero pretty quick. I want the ...

DataGrid - Edit the selected row when a button is clicked.

Hi all. I have a very simple DataGrid with 2 columns, some thing like this: <mx:DataGrid id="grid" > <mx:columns> <mx:DataGridColumn dataField="name" headerText="Name"/> <mx:DataGridColumn dataField="date" headerText="Date"/> </mx:columns> </mx:DataGrid> What Im trying to do is to activate the edition of the s...

ComboBox dropdown scaling does not follow DisplayList...

I've been working on an application (with ComboBoxes) that requires scaling the entire application based on screen resolution. I thought it would simply require changing the "scaleX" and "scaleY" properties of the top-level application, but discovered that the ComboBox dropdown doesn't appear to scale accordingly, as in the following ex...

Box2D Walls - same code: the left one works, the right one doesn't

I'm making a simple Box2D game ( http://iwanttobeacircle.com ), where you start off as a triangle and bounce off bigger shapes to gain sides. I'm having a bizarre bug with my walls... both are created from the same class, yet the left one works and the right doesn't. If I only add the right one, then it works, but for some reason adding...

Dynamic loading and compilation of MXML/AS at runtime

Greetings! I am trying to build an application which has a flex front-end and a php back-end. I am struggling to do something with this application which I couldn't figure out a way to do. I would want my flex application to show a view based on an MXML it recieves from the server as a response to some interaction in the flex applicatio...

Error: "NetStream.Play.StreamNotFound" while playing mp4 file using NetStream object (Actionscript/Flex)

Hi, I am using NetStream, NetConnection and Video object to play an mp4 file which is hosted over a web server using http. The mp4 file URL is for example: http://xx.xx.xx.xx/file.mp4 This is an AIR application and the relevant code is pasted below: var url:String = <some http url>; connect_nc = new...

Why does this XML query not work?

Heres some code for a test case. I don't understand why the first two queries produce a result but the third one doesn't. Any ideas? <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onInit();" > <mx:Script> <![CDATA[ private function onInit...

Flash Camera Permissions Dialog: Why does it sometimes take more than one click to work?

Often, but not always, the first few clicks on the "Allow" button on the Flash camera permissions dialog are ignored. This is very frustrating for users. And for me, when I'm testing code! I'm afraid I don't really know what else to say about the problem to give more insight. My hunch is that it has something to do with getting focus on ...

How to correctly load an .md2 mesh description with Papervision 3D 2.1.932 ?

How to correctly load an .md2 mesh description with Papervision 3D 2.1.932 ? ...

Does Import effect your file size AS3

This might be a silly a question. But I am just curious to know if the amount of classes you import into your flash class, affect the size of the class, the size swf file, or the amount of memory allocated. If so, does this affect take place before or after you initiate the class. thanks ...

scripts that interact with flash objects on webpages

Hey everyone, I was wondering if there was a scripting language that one could use to to interact with a flash object on a webpage? I am trying to automate some tasks but the webpage uses flash. Thanks for the help! Edit: I am trying to fill out a form basically click a few "check boxes" and then a submit button but I would like to ...

what is SWC, when/where we use SWC in Flash

hi, Does any one know what is SWC and where we use this SWC in Flash Development. thanks in advance ...

Two-up page view in Flashpaper

I need some help on flashpaper, I just wanted to show the pages in two-up view, like the Adobe reader i.e we can see two pages at a time. See if anyone can help me with it or just give me any other option which would include the two-up page view and exclude download or save or print and the logo of the company. Hoping for a soon reply. ...

Page transition effects in flash

What are possible ways to implement page transition effects in flash? e.g. page turning. Thanks. ...

Setting Actionscript Object Keys

If I have an array, I can set the keys by doing the following: var example:Array = new Array(); example[20] = "500,45"; example[324] = "432,23"; If I want to do something with Objects, how would I achieve this? I tried the following: var example:Object = [{x:500, y:45}, {x:432, y:23}]; // Works but keys are 0 and 1 var example:Obj...

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.

In my game, I encapsulate my addChild so that I can have an array of all the objects that are on stage for later garbage collection. this is how I do so public function addGameChild(object:gameObject,isDisplay:Boolean = true):void { if(isDisplay) addChild(object); gameStage.push(object); ...

Using Enter_Frame as a timer Flash

I am trying to save memory and space. So instead of using the Timer for my application, I was thinking about using my main loop (ENTER_FRAME) to keep track of time that passes. Is there anything wrong about this ?? ...

ActionScrpt: Library implementing a 'set' datatype?

Has anyone implemented a Set class in ActionScript? Specifically, a Set which is similar to Python's set implementation (unordered, unique, O(1) membership, etc). I'd like to be able to iterate over it using for each, perform operations like union and intersection and get a list of all the contained items… Which would all be possible to...

How can I modify my code to line through the bezier control points?

HI all - I am using anchor points and control points to create a shape using curveTo. It's all working fine, but I cannot figure out how to get my lines to go through the center of the control points (blue dots) when the line is not straight. Here is my code for drawing the shape: // clear old line and draw new / begin fil...

Custom Event Not Captured- why?

I am having a problem where I dispatch a custom event but the listener does not receive it (i.e. myHandler() in the code below). If I put everything in one mxml file, it works. When I separate the responsibilities in to separate classes, it fails. It is not clear to me what I am missing. Any help you be appreciated. Here is my code ...