actionscript-3

String to Stategy in Strategy Pattern

I'm working in AS3, but I guess this could be a general question, so I'll frame it more vaguely... I'm using an XML file to define parameters for a particular class of object that implements the Strategy Pattern. There will be large variety of objects, and this works for us as a designer friendly solution to customizing these objects. A...

Saving and Loading XML file with flex

Hello Community, I want to have a xml file for my configuration and so i have to load it from the same directory the swf file lies in and save it afterwards. I saw articles about filestreams in flex but my compiler didn't allow me to use the filestream. I use the open source flex sdk. anyone got an idea? thanks in advance Sebastian ...

for loop to print year in ActionScript

I need a for loop which would print from year 2000 to 2099. [Bindable] private var yearValue:Array private function we():void { var i:Number; for(i=2000;i<=2099;i++){ yearValue = new Array(i); } } <mx:ComboBox id='year' labelField="Year" dataProvider="{yearValue}"> </mx:ComboBox> When i ...

How to return a copy of an object instead of a reference in actionscript 3?

Imagine I have an object called "image", now I want to create multiply copies of this image to display it multiple times and with different properties. When I do image2 = image;, only the reference is copied and I thus still change the properties of the first object. So, how to return a copy of an object instead of a reference in action...

Creating and editing CSS in Flex3 Air

Hi, I need to create a CSS file via the Flex 3 Air application. I need to create and edit the CSS file and access individual styles by class name. Please give any examples or related links of which you aware. Thanks & Regards Vinod.P ...

Create a timeline from date to date in Flex/AS3

Hi, I need to create a timeline between 2 given dates, ie: 2006-01-20 - 2009-02-14 The timeline must be drawn on a given width (can be altered), ie: 600px But I need to add markers, one on year beginning, and others 4 times during the year (each 73 days aprox): Any tips? ...

Having trouble with Interactive Plane

I am having some trouble getting an interactive, animated plane created from a MovieClip in the Library to show any kind of animation or receive any mouse events. Specifically, I am having issues with the different states of Button instances in the MovieClip. Here's the basic code that I am testing with: private function init3D():voi...

HttpService requestTimeout

How do I determine if the HttpService instance timed out? Thanks! ...

Dyanmically updating Legends - ActionScript 3

Hey All, I have some issues in updating the legends created using action script. Please read the following steps to understand the issue. Created a line chart with two data Series. Created a legend. Appended chart and legend to a container. There is an update button. Clicked on the button. Now the line chart was updated with three da...

hitTestObject collision detection not working in as3!

I am trying to create a platformer game and i am trying to make "player1" stop when it hits a "platform". here is my code so far, gotoAndStop("gameStart"); import flash.display.MovieClip; import flash.events.*; import flash.ui.Keyboard; import flash.ui.*; import flash.utils.Timer; import flash.events.TimerEvent; player1.gotoAndS...

Cannot access ActionScript 3 Sprite.graphics.x methods

I have this code: package graphics { import flash.display.Sprite; import flash.events.*; public class Ball extends Sprite { public function Ball(_stage){ _stage.addChild(this); drawBall(); } private function drawBall(){ graphics.beginFill(0x0000CC); graphics.lineStyle(2,0x000000,1); graphics.drawCircle(0,0,10); ...

Loading symbols from an AS2 SWF into an AS3 application?

I am converting a large application from AS2 to AS3. Part of the function is that it loads assets embedded in SWFs, which are old things. It is not possible to convert these to AS3 (there's really no code in them, it's just they're produced by tools that output flash 6 compatible SWFs). The question is, how can I use this AVM1 (ActionS...

as3: how to disable event listener

im trying to make an image gallery. the container class that adds the thumbnail as follows... for (i=0; i < xmlLength; i++) { thumbnail[i] = new Image(relPath + "/images/" + imageList[i], imageTitle[i], stage); thumbnail[i].addEventListener(MouseEvent.CLICK, shiftStack); thumbnail[i].addEventListener(MouseEvent.MOUSE_OV...

Component names and ids in Flex and Actionscript, where do they come from?

To illustrate my question. Assume the following code snippet: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&gt; <mx:Script> <![CDATA[ import mx.controls.Button; private function createButton():void { var myButton:Button = new Button(); myButton.label = "...

How to implement an XML-RPC server in AS3 (Flash or AIR runtime)?

I'm looking for a good XML-RPC server implementation to be included as part of an existing Flash+AS3 application in order to be notified on events by a client. The ideal implementation should be well written, documented, reliable and encapsulated in order to be easily and cleanly wrapped. EDIT: I'm working on porting the app on Adobe A...

mootools.swiff : loaderInfo never completes

[EDIT 07-22-2010] removed deoms from my site[/EDIT] [EDIT 08-26-2009] added really weird issue to the bottom of question[/EDIT] Hi everyone I'm trying to get going with the mootools swiff thing and I seem not to get the loaderInfo.COMPLETE event in flash. more precisely a dynamically loaded swf never loads completely, while a static one ...

Extending the Sprite class for convenience?

I'm always tempted to extend the Sprite class just so my object can be part of the display list (and also have EventDispatcher functions), even though it has nothing to display. It will, however, contain things to be displayed. It's convenient because those contained objects need only reference their container for display list access. H...

Selecting Flex chart items and displaying sum of items selected

I would like to use the selectionMode=multiple described in the Flex docs, but with a few modifications: 1) I would like the box that the user drags over the graph to remain there until the user drags a new one. 2) In the top right corner of the box I want to display the sum of the items selected by that box. Does anyone have any exam...

Passing in variables ByRef in Actionscript 3

Is it possible to pass a parameter to a method ByRef (or out etc) in ActionScript 3? I have some globally scoped variables at the top of my class and my method will populate that variable if it's == null. I'm passing in the variable which needs to be populated but so far my efforts have returned a locally populated variable leaving the...

How to add all symbols in library folder to stage at runtime

Hi, I just submitted this question but i can't see if it posted anywhere, so I apologize if this is a duplicate. For a Flash CS4 project, I am constantly importing new images, converting them to movieclips and storing them in the library under an "Ornaments" folder. All of these ornaments need to be on the stage in a certain place wh...