actionscript-3

How to always force show ColorPicker's dropdown color list?

To show the complete list of available colors, one has to click the color box of ColorPicker control. How can the component be modified to forcefully always shown the colors list without any interaction from the user? ...

access symbol in "external" swf AS3

I can do 2-things. Load an external swf, and change the color of an object. When I put these two things together, it doesn't work. How do I change the color of the loaded swf? I want to access instance names in loaded swf files. WHAT I WAS TOLD I have to package it and set up a class paths. Is there an easy way for now? ball.swf "w...

Flash 10.1 Multitouch in OSX

Hey, I want to play with the new multitouch functionality of Flash 10.1 as is demonstrated here: http://blog.martinlegris.com/2009/12/13/tutorial-multi-touch-in-as3-flash-player-101-part-1/#more-186 removeEventListener(Event.ADDED_TO_STAGE, init); // entry point _tf = new TextField(); _tf.width = stage.stageWidth; _tf.height = stage.sta...

Dynamicly embed symbols from a swf?

I'm trying to embed an x number of symbols with this: [Embed(source='graphics/backgrounds.swf', symbol='background01')] private var Background01 : Class; the problem is that i have like 100 background symbols and would like to embed them without writing every single one like the code below here: [Embed(source='graphics/backgrounds.s...

flex: Create a screenshot of UI element

Hi! I want to make a screenshot of custom as3 ui element (which was extended from Canvas), and then upload the image on the server. Could you help me with a small example of this? I am trying to do the following: // This is UI component extended from Canvas var chessBoard:ChessBoard = new ChessBoard(); // I displayed pieces on ...

Actionscript 3: Memory Leak in Server Polling Presentation App

I'm building a remote presentation tool in AS3. In a nutshell, one user (the presenter) has access to a "table of contents" HTML page with links for each slide in the presentation, and an arbitrary number of viewers can watch the presentation on another page, which in turn is in the form of a SWF that polls the server every second to en...

learning string arguments, Flash AS3

I'm bad with strings and probably messed this up. My Flash file receives XML commands and changes the value of the animations (speed, time). Can you improve this string argument or give me an idea what I need to do differently. XML <head> </head> <body> <cnt>1count*count/10</cnt> </body> IS THIS RIGHT? ...

How to get the frame labels of the main timeline in ActionScript 3?

For the life of me I can't figure out how to trace out the current label in my movie's main timeline. This is in AS3. I have a button on stage that spans the timeline of the movie. It detects keypresses. I want to trace the current frame label that the play head is on. on(keypress "<left>") { trace(this); trace(this.currentFrameLa...

I'm trying to set up my collision detect so that it ignores a child of the target. (Actionscript 3)

So in my game, every 'enemy' movieclip creates a textfield that represents the name of the enemy. The problem is, I want my collision detect engine to detect a collision with the enemy itself, not the textfield. This is the code that I have currently have on my collision class for detecting a collision with the enemy: for(var i = 0;i ...

Actionscript 3D how to develop 3d sprite

I am developing a flash application required me to have a rotational sprite object cycling around the 3D space. I saw a MovieClip has a z-index that can be used as z coordinates in 3d space but couldn't find it in sprite object. How to I get around with that. ...

Actionscript duplicate variable definition

if(true) { var a:int = 1; } else { var a:int = 2; } In the above actionscript code I get duplicate variable definition error because "a" has been declared twice. But, doesn't "a" exist in two "different" scopes? Is there an elegant way of removing this warning, rather than pulling "a" out of both the scopes and moving it outside...

Flash AS3: NetStream buffer control

Hi, I have two FLV video players on a stage using two AS3 NetStream objects for playback. I need to have the two players synchronized, meaning that the playback should start when the buffer is full for both streams, and both should be paused when one of the buffers empties, waiting until refills again. My problem is, that the buffering...

Floodfill in ActionScript 3

Hi guys, I'm trying to write my own floodfill function in ActionScript3, because the one provided by Adobe isn't flexible enough (you can only give one target color, I would like to give a range of target colours.) So, the terrible code I came up with so far is this: private function beginAlgortime(xx:int,yy:int):void { if (bmp.bi...

Main function in flash?

Hi, I'm trying to start off a as3.0 project with nothing in the maintimline, I want my default actionscript class to start things off. Like a main in C, so is there a main like function in AS3.0 ? ...

Update UIComponent size

Hi, I've created a AS3 class which extends UIComponent so that I can easily add it to my MXML layout. It works fine, but I'm trying to figure out how to update the UIComponent width and height dynamically. I want my super UIComponent to draw a border around the content, so I need get the specific 'content' dimensions in order to do this...

bytesAvailable, readUTF() and ProgressEvent.SOCKET_DATA

Hello, I have multiplayer game, which reads XML data from the server: _socket = new Socket(); _socket.addEventListener(ProgressEvent.SOCKET_DATA, handleTcpData); ..... private function handleTcpData(event:Event):void { while (_socket.bytesAvailable) { var str:String = _socket.readUTF(); updateGUI(str); } } In most cas...

ASP.NET converting action script code into ASP equivalent (2D array)

I'm building a ASP.net quiz engine and I'm using a previous quiz engine i did in Flash as a template for the ASP version. I'm stuck on how I can achieve the following code in ASP.net // array to hold the answers var arrAnswers:Array = new Array(); // create and array of answers for the given question arrAnswers[i] = new Array(); // loop...

Flash TextField, dynamic size

I'm building text balloons to display variable length messages in Flash. My question is pretty simple, though the answer may not be. I have: The string I want to display. The font information. The width/height ratio I want the text field to have. How do I calculate the width and height of the text field it needs to display the text ...

How can I achieve a smooth painted curve for a white board app?

I'm building a simple white board app in ActionScript 3. Most white board or painting apps in ActionScript tend to use an interval, timer, mouseMove event, or enterFrame event to track the mouse position and paint lines or brushes in between the tracked points. What I'm trying to achieve is the nice smooth painted line that a program l...

as3: How to upload bitmap data to server using httpRequest

Hi! I captured screenshot of my ui element, and would like to send it to server, using httpService. Currently I am doing the following: var httpService:HTTPService = new HTTPService(); httpService.method = "POST"; httpService.url = "/admin/compositions/add/"; httpService.addEventListener(ResultEvent.RESULT, onresult); var bitmapData:B...