actionscript-3

Left property in MXML - Flex 4 SDK

Why does the following button not line up 100px from the left edge? <mx:Button left="100"></mx:Button> I am using the Flex 4(Gumbo) SDK, I am pretty sure that if you try to do it in FlashBuilder, it would work. ...

AS3 using PrintJob to print a MovieClip

Hello, I am currently trying to create a function which will allow me to pass in a movieclip and print it. Here is the simplified version of the function: function printMovieClip(clip:MovieClip) { var printJob:PrintJob = new PrintJob(); var numPages:int = 0; var printY:int = 0; var printHeight:Number; if ( printJob.start() ) { /* R...

air.Microphone.getMicrophone();

may i know how to use this getMicrophone with simpleFLVWriter to create flv with sound? can elaborate? ...

HTTP Post fields are not received by PHP script

I feel stupid asking this question, but I've been wrestling with it for hours and I don't know where else to turn. I have a flash form that is making a POST request to a php script, and then displays the output of the said script. For the sake of simplicity, let's say this is the php script: echo 'Mail sent to: ' . $_POST['recipientEm...

Actionscript 3.0 network programming with C#

Hey guys, I was looking into network programming with AS3 and I noticed that all the examples were using Java to code a server. I tried using C# to make one but it wasn't working as expected. I was wondering, does anyone have a really simple example of AS3 networking using a C# server? Thanks. ...

flash as3 - Can't have classes of the same name in different swfs?

Say I have 3 different swfs: dog.swf, cat.swf, mouse.swf, and each has their corresponding fla file. In the fla files I have movie clips like "head" and "tail", which are exported for Actionscript with names like Head and Tail, and each just contains an image. The problem comes when I have a main swf that loads and unloads these animal ...

Very odd null object RTE on FocusManager

Hi all, I am getting this error, randomly when I start my application (and it's sub applications). As you can see the stack trace is rather useless, although through the debugger I can see the parent of container (second in the stack) is an MXML class that has a repeater that repeats another component. Therefore I guess the component ...

Is it possible to retrieve the swf metadata within the actionscript of a flex project?

I know that it is possible to add swf metadata to the compile command as a command option, but I can't find any documentation on how to access these metadata within the actionscript during runtime. We're trying to add a version number to the swf during compile time and then somewhere in our app we would retrieve it during runtime, here i...

What are the pros and cons of migrating an application from AS2 to AS3?

I have a client asking me "What are the pros and cons with upgrading from AS2/Flash to AS3/Flex?" He is having performance and maintainability issues with his app. I sorta hate these questions because I just want to say "AS3/Flex is going to be faster and more maintainable," but I know I should be more specific than that. The applicat...

Get URL of current page from Flex 3?

How do I determine the URL of the current page from within Flex? ...

Flash / Flex crossdomain.xml help...

I am trying to figure out how to properly setup my crossdomain file. Here is what I have so far: <?xml version="1.0"?> <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"&gt; <cross-domain-policy> <site-control permitted-cross-domain-policies="all" /> <allow-access-from domain="cont...

application-context.xml problem for Spring ActionScript

content of The application-content.xml is <?xml version="1.0" encoding="utf-8"?> <objects xmlns="http://www.springactionscript.org/schema/objects" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springactionscript.org/schema/objects http://www.springac...

Add days to Date in ActionScript

We have an application in which the user has to enter a date who's value is no more than 30 days after the the current date (the date on which the user uses the application). This is a Flash application, therefore I need a way to add 30 days to the current date, and get the right date. Something like in JavaScript: myDate.setDate(myDate...

Flash Font embedding problem

I am facing a wired problem with a project. I am embedding Arial font as project is multi-lingual. If I build this project on one of my development machine, Font gets embedded successfully but in any of other machine, project successfully gets published without any warning but font just dont get embedded in SWF. Note : Project code base...

Managing object instances

I want to be able to create and unknown number of objects. I'm not sure if there is a better way to manage and reference them. Lets use a standard OOP example... say every time a user enters a name for a pet in a text field and clicks a button a new pet object is created via the petFactory function. function pet(name) { this.nam...

Binding to a read-only getter in AS3

Consider the following code: [Bindable(event="ReportHeaderVO_effectiveFromDateJulian_updated")] public function set effectiveFromDateJulian ( value:Number ) : void { _effectiveFromDateJulian = value; dispatchEvent( new FlexEvent("ReportHeaderVO_effectiveFromDateJulian_updated") ); } public function get effectiveFromDateJulian (...

Can E4X Get Attribute of a Parent Node Based on Attribute of a Child At Any Level?

Hi, I'm struggling with some E4X and hope you can help. Here's my XML structure: <xml> <node type="bar"> <subnode id="4"> <subnode id="5"/> </subnode> <subnode id="6"/> </node> <node type="foo"> <subnode id="7"> <subnode id="8"> <subnode id="9"/> </subno...

How to stick position of one Sprite to another?

I have the following code: if (i==0) sprites[i].y = 0; else sprites[i].y = sprites[i-1].y + sprites[i-1].height; Every Sprite can have a different height. Height of a Sprite can change on user action. When the height of some Sprite changes, I would like to update the position of other sprites accordingly. I am looking for an obj...

Firefox reloads SWF file on resize & loses context

I have a Flex application. I use SWFObject (v 1.4) to "add it" onto the web page. When the webpage loads, Javascript is used to initialize some variable in the Flex app. Then the Flex app loads some images and displays it to the user. With Firefox, after everything has been loaded, when I resize the browser, the Flex app is reloaded. I ...

How to save a snapshot of a SWF to the server with AS3?

I am facing the task of having to upload a snapshot to the server. But I don't want the user to download the image to their computer. I have explored a few solutions of generating an image serverside with PHP, but they all seem to use a method where the server sends the image to the user. See for instance: http://mattkenefick.com/blo...