actionscript-3

AS3 ActionScript not running from the TimeLine on a loaded movieclip

I have a AS3 Flash file with some animations during the timeline. On the timeline I also have a stop() in the middle (on a keyframe). When I run this SWF file it does stop. But if I load if from another Flash file using a Loader object it does not stops (nor runs any other action script - i.e.: trace("hi")) I'm also including the context...

FlexEvent.APPLICATION_COMPLETE never called in simple app

Hello, I've got a really simple flex application, with a main file Rec.mxml: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="215" minHeight="138" width="215" height="138" background...

Flash, ActionScript 3: using get/set properties to get values from other classes creates much duplicate code can it different?`

hi, i am using get and setters in my as3 code to edit values of an other class (because those variables are shared) i dont like to put stage.sharedVar.isScrabble in my code every time to change a variable so i used get/set functions see below private function get isScrabble(){return stage.sharedVar.isScrabble;} private function set i...

ActionScript 3: how to create a array or list like: array["name1"] = "hello" (just like you can do in PHP)

hello, in PHP i am used to create a array with using names as keys like array["something1"] = "output1"; array["something2"] = "output2"; array["something3"] = "output3"; and then use foreach to let them print or do other things with it like foreach ($array as $key => $value) { echo "$key = $value"; } is there something similar po...

How come a swf can not reference mxml components on an event?

this piece of code is being placed inside a swf which is then being placed inside a mxml swfloader. The ProductDesigner is the name of the application and the selectRed is a HSlider mxml component. The error that I receive is that "Access of undefined property ProductDesigner" in the Flash CS5 when testing the swf. Yes I am able to pick ...

overriding inherited getters/setters

I have a class (Wall) that inherits from Sprite. Sprite already has width and height properties. But for wall, I need to do some other additional calculations when the properties change (f.e. make sure the new size won't cause it to overlap any other walls). So, how do I set the width property inherited from the Sprite class from withi...

Facebook iFrame application: How to pass data from URL Query String

Hello! I have a Facebook application that has a picture gallery. It's build in Flex 4. I want to allow users to link to a specific image. How can that be done? The only way I see this being done is adding a GET var like &my_picture=asd.jpg in the Facebook page URL, but I don't know how to read that from the iFrame. ...

Forcing custom item renders to refresh

I have an AdvancedDataGrid. One of the columns in the grid displayed with help of custom render. During the application run, I set another custom render to the same column. When I scroll data in the grid (change values for the custom renders) they display new view correctly. I want that they dispaly new view automatically (when I set th...

ActionScript Refactoring NumericStepper And Slider Code

i'm creating NumericStepper and Slider component objects. both have very similar properties, except for a few. i'd like to refactor the code for creating them, but i'm not sure about the best way of doing so. var numericStepper:NumericStepper = new NumericStepper(); numericStepper.width = 50; numericStepper.minimum = 1; numericStepper...

sync client time to server time, i.e. to make client application independant of the local computer time

Ok, so the situation is as follows. I have a server with services for a game, a particular command from the server sends a timestamp for when the next game round should commence. To get this perfectly synced on all connected clients I also have a webbservice that returns a timestamp of the servers current time. What I know: the time be...

Flex/Actionscript Type error #1034

I'm trying to detect overlap between elements on my canvas. The attempt is to reuse some of the code for collision detection at http://www.gskinner.com/blog/archives/2005/08/flash_8_shape_b.html This is the smallest MXML sample I could come up with that gives me a type error. <s:Application xmlns:fx="http://ns.adobe.com/mxml/200...

Handling events from custom header renderer in AdvancedDataGrid.

Hi all! I have to create a custom header for the AdvancedDataGrid component. The custom header must have two buttons in it. The custom renderer must be applied to more than one column. How I can fire, dispatch and handle events from the custom headers? Any examples or tutorials are welcome! ...

Flash - Password login fail on Ctrl+Enter keypress

Hi. I'm using Flash CS4 and AS 3.0 I'm trying to add a login for running my flash movie. When the user clicks the login button, the text of the password field is authenticated, which allows gotoAndPlay(2) . But the problem is both in my .swf and my projector .exe i can easily jump the login frame by pressing Ctrl+Enter . ...

Chrome AS3 URLLoader different behavior on network error

In Chrome upon network error, the event object in error handler is behaving differently than IE and flash player (i.e. directly running the swf, not from the browser). Consider the following test code : private function loadData():void { var loader:URLLoader = new URLLoader(); loader.addEventListener(IOErrorEvent.IO_ERROR, onEr...

How to make a fish swim smoother in Flash

First,Sorry for my English. I wanted to make a flash game,it's about some fish swiming in a tank. All the fishes swim randomly,i don't need any rotation,just left and right direction will be fine with me. But the result is their actions are really odd. Can someone tell me how to make them swim just like real fishes? And there's also ano...

where can I download AS3 flash platform full documentation?

Hi, does anyone know how/where to download actionscript 3 flash platform full documentation in packed HTML files. What I want is to have a local copy of the following doc: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Bitmap.html?allClasses=1#bitmapData We are currently using a local copy of FLASH4 a...

open flash player and test swf from textmate

i usually write my code with textmate. a custom command for testing the proj directly in flash is: echo 'document.testMovie();' > /tmp/fc.jsfl open -a /Applications/Adobe\ Flash\ CS5/Adobe\ Flash\ CS5.app /tmp/fc.jsfl what about the flash standalone player? echo 'document.testMovie();' > /tmp/fc.jsfl open -a /Applications/Adobe\ Fla...

How to access XMLList nodes in AS3

I am working with an XML list at the moment, which looks like this: <feature type="startLocation" value="1" x="15" y="3"/> <feature type="startLocation" value="1" x="15" y="4"/> <feature type="startLocation" value="1" x="15" y="5"/> <feature type="startLocation" value="1" x="15" y="6"/> <feature type="startLocation" value="1" x="15" y="...

[AS3] vertical scroll based on mouseY

hello! :) i've to write a simple method, wich allow me to move a movieclip inside another one, like in http://www.cballestimenti.it/ (i've to move it in vertical, instead of horizontal). i've write this simple code but it seems to not work properly...can anyone help me? thanks a lot in advance! public function factor():void { thumb...

flex datagrid data on datachange

Hi all, I am using an extended datagrid which takes its height on the basis of measured height of items. Item renderer for datagrid is a canvas. Which holds one more canvas(header for item renderer) and a text area. The problem I am facing is with the header canvas in item renderer. Header canvas has one label which diaplay a name of us...