actionscript-3

Why does the Flex compiler generate varying file sizes on successive compilations of the exact same source code?

I'm building a SWF using the command line compiler mxmlc.exe. The compiler writes the output file size as part of it's stdout. If I run the compiler multiple times in succession without changing the actual source code, I see the file size bounce up and down a few bytes at a time. C:\>mxmlc.exe Gallery.as C:\Gallery.swf (28443 bytes) ...

Can I extend Function's prototype in ActionScript?

I am trying to incorporate prototype.js's bind() function into my Flash component. I found this article by Jordan Broughs, which gave me hope. He suggested using this code snippet: Function.prototype.bind = function():Function { var __method:Function = this; var object:Object = arguments[0]; return function():void { _...

diacritics in flash

Hi, my question is maybe a dumb one, but i cant help myself - i created a flash movie with a dynamicly inserted textfield, that loads its text from a file, but i have problems viewing diacritics like ľščťžýáíé in it. I tried to change font, but it didnt help. Can anybody help me? ...

How do I reference a Global class from a class with the same name in ActionScript?

Due to requirements outside of my control (don't ask, it's ridiculous) I need to create an AS3 class called 'Math' that references the Global AS Math class. So, for example: package my.package { public class Math { public static function pow( a:Number, b:Number ):Number { // How do I call the Global.as$Math#...

Flash HTML image link AS3

I have a flash as3 file, and I'm importing an HTML file that contains this link: <a href="purchase.php?lang=0&"><img src="https://www.paypal.com/en_GB/i/btn/btn_buynowCC_LG.gif" id="paypal_button"></a> and I cannot for the life of me figure it out, I've looked everywhere. There were a couple of forums that suggested: function onTick...

Renaming XML nodes using E4X in AS3

I have an XML object in AS3 that is formatted as follows: <data> <nodes> <item></item> <item></item> ... </nodes> <nodes> <item></item> <item></item> ... </nodes> ... </data> My problem is I want to rename the node names("nodes" and "item") to something more relevant e.g. "nodes" could be "author", an...

flex air datagrid itemRenderer

Hi, I have a datagrid with custom itemRenderer. When I click in a cell, I get its reference. Now I would like to get the reference of the other column in the sae row. e.g. In the datagrid I have clicked in 4th column of the 3rd row, I am getting reference of it no problem in that. Now I would like to get the reference of 1st column o...

Why doesn't ActionScript have "generics"?

Can anyone tell me why ActionScript 3, a statically typed language, doesn't have generics? Is it too much work? A historical thing? Is there some way to "fake" it that I haven't picked up yet? Edit: thanks a lot for the answers! The Vector class is basically what I was looking for, and the other information was helpful too. ...

Creating Photo-Flow (itune-like navigation) dynamically - Any Free or Easy way to do this?

I'm wondering if there is a free script or easy tutorial on how to make photo-flow like the top of this website. It is similar to how itunes album navigation works. So far, all I found is this non-free photo flow. I was wondering if this can be done without paying any money. ...

How to create dynamic variable vbox in actionscript

Hello, I have to create several vbox-es in a for each loop. Now I want to do something like this. formsArray["vb"+counter] = new VBox; formsArray["vb"+counter].visible = true; add labels etc. I can't get this thing to work. Anybody any idea how to create dynamic variable names for my vbox-es? Thanks ...

How can I set "maxChars" of the TextInput in an editable ComboBox?

I want to set the maxChars property of the TextInput of an editable ComboBox. I am currently trimming the text to a set number of characters using a change Event: private function nameOptionSelector_changeHandler(event:ListEvent):void { nameOptionSelector.text = nameOptionSelector.text.substr(0, MAX_LENGTH); } This feels like over...

AS3: script a button to its rollover state?

Hello, Anyone know if it is possible via AS3 to change a button to its rollover state when it is not, in reality, rolled over? Client decided way late in process to ask for some other elements to affect button states. If I had known I would have used movie clips instead of buttons. Thanks for any advice, JG ...

AS3 - Dispatch Event Issue

I have an Flash AS3 project that loads external SWFs and controls them in different ways. On some of the loaded SWF files, they have a "Next Selection" button that takes you to a new presentation. On my main externally loaded SWF, I have the code: setTimeout(function() {dispatchEvent(new Event("nextPresentation", false));}, 4000); W...

AS2 to AS3 Migration, Handling code left on buttons

I have several (20-30) Flash files that I need to migrate from AS2 to AS3. The biggest issue that I'm having is that it's extremely tedious to go through all the code and change the places where the code is on the buttons to an event handler model. I'm not hopeful, but I was wondering if anyone knew of any tricks or tools to quickly ch...

AS3/Flex: How to make mxml files loaded via ViewStack see their parent's variables, etc.?

For a project I'm working on in Flex I decided to create several separate files for each 'theme' that can be used. Since each theme can and will require specific code, images, styles and virtually anything else, the classical css-only option was not really possible. I have one problem with this method, and that's that each 'child' mxml ...

f4p flash video format

What is the difference between .f4v and .f4p flash video formats. Only information I have found on Adobe website is that f4p is "Protected media for Flash Player". Well my question is: how is it protected? ehat type of protection is that? Ways of encoding? Anything really... Cheers. ...

Getting Computer information using Flash

Is it possible to retrieve computer information (RAM, hard drive size, cpu speed, etc.) using Adobe Flash? If so, can someone point me to a web site showing me how? ...

Google Maps Flash API disables bubbling of MouseEvent over their Markers

By default Google Maps Flash API cancels bubbling of all MouseEvents that occur over their Markers (dragable at least). However in MapMouseEvent constructor I see that it has a parameter "bubbles?" so I guess they can be made to bubble mouse events? Is there a way to turn bubbling of mouse events on? var __marker = new Marker(new LatLng...

Flash External Interface issue with Firefox

I am having a hard time getting ExternalInterface to work on Firefox. I am trying to call a AS3 function from javascript. The SWF is setup with the right callbacks and it is working in IE. I am using AC_RunActiveContent.js to embed the swf into my page. However, I have modified it to add an ID to the Object / Embed Tags. Below are o...

Flex Image source event, How to know when the new source is received ?

Hi all :) I have a simple Image component, I change its source dynamically on creation. myimg.source = "http://foo/bar.jpg" How can i know when the image is loaded and received so that i can check its width ? Thanks ...