actionscript

AS3 Timers vs. ENTER_FRAME performance

I'm building a game that got some moving things all the time, so I'm using a lot of Timer instances to control repetition and trigger motion. Now the thing is that I started to notice some performance "lags". Is this due to the timers? and do you suggest using ENTER_FRAME event instead? Related: Do you suggest any other library/metho...

How to add an image as pre-loader in a Flash CS4 file?

I have a flash file (.fla) which is created in Adobe Flash CS4. I want to add pre-loader which is basically a simple .gif image (my company logo). I want when someone run that flash (.swf) file, first for at least 3 seconds my company logo will be displayed and then the rest flash file will execute. I am new to Flash CS4, so can anyon...

How can I import an interop dll into actionscript

Making an adobe flex ui in which data that is calculated must use proprietary functions from a dll. How can I import this dll into actionscript? Is this the only way to achieve my goal? Thanks! ...

ActionScript - how do you get the max day in the current month

In ActionScript, how do you get the day number at the end of the month? June Example getEndOfMonth() returns 30; July Example getEndOfMonth() returns 31; ...

JS/Flash - Drag anchor containing img vs Drag img w/out anchor - How to get the img inside the anchor?

Cryptic title, but it's hard to explain. With Firefox, head over to http://images.google.com do a random search, and then drag the first search result to the URL bar. You'll see it it goes to the page that had the image anchor. Then click the "see full size image" link, and then drag the image to the address bar. In the first example...

Inspect UI elements in Flex

Is there any tool available for Flex applications that acts similar to Web Developer or Firebug toolbar to inspect UI elements? Basically in a complex hierarchy of UI controls allowing you to browse the elements and see properties such as x and y coordinates, width, height, id. I'm interested in tools that would allow you to do this a...

Position of axis labels on a Flex Chart, and how to position things relative to them

I am using an AxisRenderer that is positioned to the right of a BarChart and am looking for a way to position a title for the values in the AxisRenderer above them. How do you find the position of the labels in an axis renderer? It seems like AxisRenderer.width returns the width of the chart and AxisRenderer.x returns the edge of the...

Flash Actionscript NTLM authentication example?

Does anyone have an example of calling a webservice from actionscript 3.0 with NTLM authentication in place. The adobe livedocs list NTLM authentication as supported but I can't figure out where to pass user credentials. Thanks, Peter ...

How can I interpret an E4X property as a Date in Flex?

I've got XML that looks like this: <item> <itemDate>07/10/2009</itemDate> </item> I would like to be able to read this in as an E4X object: item.itemDate and have itemDate be an ActionScript Date object instead of a string. Is this possible? ...

Compile an ActionScript class that is in a package to a swf using Flex Builder 3

How do I configure an ActionScript Project in Flex Builder 3 Pro so that I can compile an ActionScript class that is part of a package into a swf. For example, the class that I want to compile to swf is: package utils { import flash.display.Sprite; public class Tool extends Sprite { public function Tool() { } } T...

MOUSE_OUT events not firing on child when parent is mouseEnabled=false, mouseChildren=false

I make a sprite, then add a child sprite. I add a listener to the child for MOUSE_OUT events. If my mouse is in the child sprite when I set the parent sprite mouseEnabled=false and mouseChildren=false, MOUSE_OUT is not fired on the child. But then, when I move the mouse, MOUSE_OUT is fired on the child. MOUSE_OUT is also fired if I c...

Inject to NPSWF32.dll & Flash10a.ocx & flashplayer.xpt to create a global ActionScript VM console and debugger?

Hi all, since all browser's Flash plugin is based on: NPSWF32.dll Flash10a.ocx flashplayer.xpt Is there a way to inject these dll's, use some voodoo to create a global ActionScript VM console and debugger? Perhaps then I can submit arbitary score to any online Flash games? ...

Recommended initialization values for numbers

Assume you have a variety of number or int based variables that you want to be initialized to some default value. But using 0 could be problematic because 0 is meaningful and could have side affects. Are there any conventions around this? I have been working in Actionscript lately and have a variety of value objects with optional param...

Actionscript: How do I rotate a text field?

How do you rotate a text field in actionscript 3.0? As soon as I change the rotation property of the text field, it does not display. for example: var txtFld:TextField = new TextField(); txtFld.x = 100; txtFld.y = 100; txtFld.width = 300; txtFld.height = 300; txtFld.text = "Test String"; txtFld.rotation = 90; addChild(txtFld); ...

How to make Flash 8 print WYSIWYG

I have an application that requires dynamic, rich-formatted printing of a .swf using Flash print. The contents of the .swf get created dynamically using XML and styled using CSS. Each bit of content (usually html styled text) is added to its own movie clip. The movie clip is then measured and placed on the master page wherever it will f...

Flash Player 10 real-time audio playback

I'm trying to playback some sample data through the new real-time audio capabilities of Flash Player 10. I started with the example given at the bottom of this page on livedocs, which seems to work fine and plays a crystal clear tone. I assume that the two writeFloat's in the example write to the left and right audio channels respective...

Comparing as2 to as1

For my recent project I need to work with as1. The problem is that I have a little bit forgotten as1, I think my last coding in as1 was nearly 8 years ago. My first question is, is there any web site to refererence as1 syntax or an as2 to as1 guide? Second one is about eval(). Is there is any difference between as2 eval to as1 eval. ...

Flash: How can I Disable or block all mouse events temporarily for an externally loaded SWF

I have SWF files that I load into my flash movie and those SWF files sometimes have mouse events that can interfere with dialogs and buttons in my flash movie. I'd like to temporarily disable the loaded SWFs mouse event handlers or block them from having any effects on my flash movie. My flash movie is AS 2. ...

ActionScript: Multiple public functions in one .as file?

As I've been working with AS I've developed a collection of utility functions. For example: $ cat utils/curried.as package utils { public function curried(f:Function, ...boundArgs):Function { function curriedHelper(...dynamicArgs):* { return f.apply(null, boundArgs.concat(dynamicArgs)); } return curriedHelper; } } ...

Layers in a swf refuse to load (occasionally, after a cache clear)

Hey guys, I have a swf with four frames. The first frame loads an external class that acts as traffic controller - looks at the root flashvars being passed in and redirects to frame 2, 3, or 4. Frame 2 is a basic login screen. There's 5 layers - 2 background layers, the login screen, and a dummy text field. I also have trace statements...