actionscript-3

Setting the font name and size in AS3 List control (flash.controls.List)

Using CS4, how do I set the font of a List control? I tried this: var myFormat:TextFormat = new TextFormat(); myFormat.font = config.settings["list font name"]; myFormat.size = Number(config.settings["list font size"]); list.setStyle("textFormat", myFormat); No dice. ...

How can I unset an (unsigned) integer in ActionScript/Flex 3?

I have a class which is called a number of times. When the application goes to the next stage these all have to be unloaded. Because of that, I created an unload() method in the class. The problem is that I can't seem to set my uint variable "charId" to null in order to "unset" it. The "delete" command is not possible either as that is ...

Margintop in actionscript3

Hello Is het possible to set a margintop for a form element in actionscript? var frm:Form = new Form(); frm.setStyle("marginTop", 20); Or something like this? Thank you ...

ActionScript 3 AsyncToken implementation

Looking for an example or documentation links as to how to implement a method returning AsyncToken. Note this is not about using/consuming a method returning AsyncToken! I wish to write such methods myself. ...

Q: How to associate linked SWC MovieClip asset with a Class in FlexBuilder Actionscript project

I'm using Flex Builder more and more and attempting to create a fairly asset heavy application all in Flex Builder. I know how to publish or export Flash assets as SWC's so they are available in Flex Builder, but what if you have a button MovieClip with frame states in Flash, which is either exported or included in the swf published as a...

Howto embed images in Actionscript 3 / Flex 3 the right way?

I'm creating a game where a lot of images are being used in Actionscript / Flex 3 (Flash). Now that I've reached the designer stage, I have to work out a structural way of using embedded images (which have to be manipulated with rotation, color, etc.). Unfortunately, after investigating a bit, it looks like you have to manually embed im...

pause / resume download with URLStream?

Is it possible to pause / resume downloads with the URLStream object? ...

Monitor browser tabs with localConnection and sense when a user closes a tab.

In my application the browser window connect with long polling(comet) with the server. If the user open several browser tabs, only one of them(called the master) communicate with the server and serves as a proxy for the other tabs. I want to use flash localConnection to exchange data between the tabs. What happens when a user closes the...

Error while assigning the data to dataGrid Dataprovided

Hi , I was trying to acces the datagrid at runtime and want to assign the data to it like public function getGridData(reportsArray:ArrayCollection):void{ reportData = reportsArray; trace(" The length of the datagrid is "+reportData.length); graphDataGrid.dataProvider = reportData; in...

Having troubles calling a Controller Post Method...

Here's my method [AcceptVerbs(HttpVerbs.Post)] public void SaveImage(FormCollection formValues) { byte[] contents = Convert.FromBase64String(Request.Form["file"]); System.IO.File.WriteAllBytes(Server.MapPath(Request.Form["name"]), contents); } It is getting posted to from this actionscript method: ...

How do I make my public static logging method write to an inputfield?

I figured out how to create a static method that is available everywhere, for example: UtilLib.as: package { public final class UtilLib { public static function getTimeStamp():uint { var now:Date = new Date(); return now.getTime(); } } } I can access this...

Flex WebService using WSDL. How to list available operations?

Hi, I'm using WebService class with WSDL. How to list available operations in WSDL and their parameters? There is operations property but it's empty. ...

Flash / ActionScript 3: Load .FLV file into a MovieClip and start playing that FLV file

How can I load a FLV file into a MovieClip (lets call the instance "flvPlaceHolder") and start playing that FLV file.. using ActionScript 3? ...

Is it possible to create a 'command line' swf?

I'd like to be able to write a .swf file that is runnable as a command line app. In other words, I would be able to create actionscript classes which can interact with stdin and stdout, and could then execute that .swf directly in the command line. I suspect that this isn't really possible. Can anyone confirm that? EDIT: A couple of th...

Security error when doing a post from a flash application to an Asp.Net MVC application...

Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://mysite.com/Content/MyFlashApp/myflash.swf cannot load data from http://www.mysite.com/Home/SaveData. at Main/encodeAndSave() ...

<mx:Style/> equivalent in ActionScript 3

Hi All, I am looking for something equivalent to the "mx:Style" tag in Flex for actionscript 3. Currently I am loading the skin using StyleManager.loadStyleDeclaration(). But this loads the skin at runtime which is not my intention. Thus am looking for something similar to "mx:Style" tag in as3 such that it embeds the skin and is not ...

Is it worth learning C to get a deeper understanding of OS'es and computers in general?

I'm currently working as a Actionscript 3 and Php developer. I started out learning Php then moved on to Actionscript 3 and now I'm learning Python. These 3 languages are high level languages which in none of them you have to worry about low level memory management and things like knowing which data type to use for different numbers. I...

Upload Video using new FileReference class

With the changes to the FileReferance rules for FP10 it is now possible to upload a local file directly to the client side application without the server roundtrip. For loading an image I use this code to deal with the ByteArray: private function completeHandler(e:Event):void { loader = new Loader(); var f:FileReference = FileRe...

Howto create map scrolling in 2D actionscript / flex 3 (flash) game?

I'm creating a 2D multiplayer game in a space environment in flash (actionscript 3 with flex builder 3). The player's character (a ship) will always be in the center. Because it has to look like the ship is moving, while it is actually always in the center, the background and all environmental objects have to move the opposite way. My t...

Resizing of AS-based Flash app from FireFox vs. IE...

I have put in some controls to allow users to resize my Flash app via Javascript: document.getElementById("flashApp").height*=1.25; document.getElementById("flashApp").width*=1.25; This works great in IE/Safari, but is ignored in Firefox. I know it's talking the the flash app and gets and sets the height/width vars ok, but the same co...