actionscript-3

Different flash Tab-Focus behavior in Firefox and Internet Explorer (Solved)

In a minigame that is part of a larger flash game we show a number of editable textfields, about 10 rows with two textfields per row. Every row of two textfields is encapsulated in a class, and objects of that type are placed under each other so that it looks like some sort of table. Now on Firefox the tab behavior is fine, after manual...

mxmlc generates different binarys (swf) even with no code changes

Hello, I'm running svn and sending swf files to my client. I realized that even without code modifications, the swf generated by mxmlc seems to be different everytime. Is it possible to make it generate the same swf file (so it does not require a svn commit) if there are no code changes? below is how I generate my swf. mxmlc -load-co...

Generic events and additional parameters in Actionscript 3.0?

Assuming the following pattern: someObjectInstance.addEventListener(MyDisplayObject.EVENT_CONSTANT, _handleMyEvent); private function _handleMyEvent( event:Event = null ):void { // Event handler logic... } If I wanted to add a required parameter to the handler function am I able to do this and still use a "generic" event and event...

How to disable and re-enable MouseEvents; buttonMode, mouseChildren and enable don't work

Basically the question could more probably be more accurately asked, how do I simply disable a button and then re-enable it? I've tried setting buttonMode to false, mouseChildren to false and enabled to false. Nothing works. I realize I could just remove the event listeners, but surely there is a more elegant and efficient way. As removi...

Actionscript 3 - Type.<T> syntax

Hi all! Is it possible to use the Type.<T> syntax with user defined classes? For example, let's say I want to create a List class, but I want the user to use it like this: var myList:List.<String> = new List.<String>; or is this syntax exclusively evailable to the Vector class only? Thanks! ...

AS3 - passing the main timeline/stage into an external class

Suppose I have the following class package { import flash.display.Stage; public class CustomObject { private var stage:Stage; public function CustomObject(stageRef:Stage) { // stage access through // constructor argument stage = stageRef; } } } Which is not a...

Escaping from XML to ActionScript 3 code

Is it possible to escape from XML, to ActionScript 3 code? Take a look at the following: <keyFrame name="myKey" delay="100ms" function="{function():void{soundCommand.execute()}}"></keyFrame> where the function():void{soundCommand.execute()} part has to be interpreted as ActionScript 3. So ideally, if I query the function attribute...

Check boxes just on tree leaf nodes in Flex

I'm having difficulty getting checkboxes on only the leaf nodes of a tree. Before anyone links it, I've seen http://www.sephiroth.it/file_detail.php?id=151# and this isn't exactly what I need. I don't want a 3-state checkbox system including both branch and leaf. I understand applying the checkbox item renderer to a data grid but not o...

How to set TextField text in loaded swf

I have a loader.swf that loads an external swf via the flash.display.Loader() class. The external swf contains a TextField that is defined on the stage in a keyframe (frame 10). How can I, from the loader.swf reference the TextField and set the .text dynamically? I've set the instance name, but get "null" when I reference it through th...

Flex PopUpManager: How can I detect the existence of a modal popup?

My Flex 3 application has some modal dialogs displayed via the PopUpManager, but there are times when I'd like other view components to know there is popup displayed. The PopUpManager doesn't have any method for actually checking the existence of popups. Is there any other way to detect this in flash/flex without writing my own global ma...

JSObject-like stuff in ActionScript 3?

I would like to ask if there is a liveconnect equivalent for ActionScript 3. I understand that there is the ExternalInterface class inside AS3 but it only supports calling a method by name. The really cool thing about Java and LiveConnect is that you can do something like function jsFunc(name) = { this.name = name; this.talk = funct...

Good way to handle ability usage within a multiplayer game?

I have written a client<>server based multiplayer game and have finished the basics (it's a flash client written in actionscript 3). The next step will be implementing a system which will allow me to easily add abilities to the game. The problem here is that an ability can do so many things. Eg. player A uses ability "repair" on player ...

set and get variables throughout moive - actionscript 3

I need to set various variables depending on what a user clicks. Those variables then need to be accessed by other movieclips. The problem is that at the time of clicking, those "other movieclips" don't exist on the timeline yet. What I have done is assign the variable to the parent movieclip, although I guess I could just as easily se...

Why can't I display slashes when using anti-alias dynamic text fields in Flash CS4.

I know what you're thinking - "Dumbass hasn't embedded his fonts" - right? Well wrong, I've told it to embedded Numerals, Punctuation and into Include these characters I have typed /£ and although it prints the pound symbol fine it skips the slash! I've tried doubling it up both in the output string and the Include these characters box...

Can you make Flash URLRequest /web services work from behind a proxy in IE?

We have a Flash application that connects to a WCF REST web service returning json data. We use URLRequest/URLLoader with POST requests, not a lower-level library using sockets like as3httpclientlib. The application runs swimmingly well in the normal course of duties, but when we are behind a corporate proxy server (ie. In Internet Exp...

Documentation of the lesser know AS3 properties.

Over the past three weeks, I have lost at least 120 man hours because of some lesser known functionality in ActionScript 3. One of the problems was that, with Internet Explorer, if there are too many messages sent through LocalConnections, it will slow the messages sent through, but in the standalone player and in Firefox, this threshol...

transform.matrix on textfields?

Changing the scale to (2, .5) on a textfield's transform.matrix just makes the font uniformly larger. Frustrating. Many other transforms just make the text disappear. I am embedding fonts, which is supposed to allow for rotating text. Well, that is one kind of transform... I would like the freedom to transform every which way. Is t...

Best practices: ENTER_FRAME vs. Timer

I'm creating a Flash game which is based on the old Pacman and I'm not sure which is the best way to control the animation. As I understand it these type of games were originally dependent on a game loop which ran faster or slower depending on the CPU, which is why I imagine that the most similar to use would be the ENTER_FRAME event. ...

Flash ComboBox stops playback of stream AS3

Ok, this one is driving me batty. I've made a custom video player in CS4. Basically, I just used The Gimp to draw a video player and saved it as a PNG, which I dragged to the stage. I didn't want to use FLVPlayback, so I used Actionscript to add a Video to the stage. var video:Video = new Video(480,360); addChild(video); I'll spare ...

Dispatch Event When Listener Is Added - ActionScript3

Is it possible to dispatch an event from an object when an event listener is added to that same object, without overriding the addEventListener method of that class? I am working on a modularized application in AS3. Several of the modules register events on a component in the main application mxml file. I would like to fire an event...