actionscript-3

Testing to see if a window is maximized

I noticed that in Windows, if you maximize a window you can not resize it until you un-maximized it again. This appears to be a normal behaviour, so I would like to remove my resize gripper when the window is maximised. At the moment I can't find a property to detect if a window is maximized, and although I could add a boolean in my con...

Send form data to HTTPService: how to approach it in Cairngorm?

The form is in a component lauched as a popUp, form data consists in: login:String password:String I thought of a few different ways, but I don't like them.. in the popUp, send button triggers a function that gets the form values and stores them in an Object, then saves the Object in the model, then dispatches a CreateSessionEvent. ...

How can you save out a String into a file in AS3?

I have a string the user has typed and I want to save it into a file on the users harddrive. Can you do that? And if so, how? ...

Global Object in ActionScript

private var _product:Product; [Bindable] public function get product():Product { return _product; } public function set product(p:Product):void { _product = p; tn.selectedIndex = 0; } <mx:Label text="{product.name}" fontSize="11" fontWeight="bo...

What is/are the (dis)advantage(s) of using weak references in EventListeners in AS3?

I've been teaching myself actionscript 3 over the past month or so and recently ran into an issue where an object kept doing things after I thought it had been removed. I figured out that the problem was caused by an event listener using the default of useWeakReference = false and I'm wondering why that's the default. what is the advant...

as3 referencing members of an array not explicitly defined

I am creating a bunch of objects in an array. I'm used to doing this iteratively, like for(i:int; i < number; i++){ ball= new Ball; balls.push(ball); } and then later I can make reference to balls[i]. Now however I'm creating the objects with mouse click, not with a for loop, so I don't have that [i], so my other code makes refe...

Changing view states on application resize

I want to change the view states in my flex app when it resizes in the browser window. I have the swf embedded at 100% x 100%. So when the user resizes the window below a certain width, I want to switch to a different state. I tried adding an event listener like this, but it only fires the event when I resize the swf outside the browser,...

what is the use of Flash Lite, is this same as Flash Action Script

I want to know is Flash Lite is same as Flash Action Script programing. When/where we use Flash Lite? ...

Logging or writing textfile from flash,as3

Hi, I am doing flash project(adobe flash cs4 proffesional) which run in browser with flsh player 10.. i need to implement error logging in text file. in my project i have try catch statement while catching the error i need to pass that error and write in text file... how to do it from browser. ,pls provide any example or link relate...

Loading object to stage with AS3

Hi, I am new to AS3 so please forgive me for asking something which is probably pretty straightforward to solve. I am trying to load an image onto the stage using an external AS3 class. I'm not sure if this is the best way to do it but I started off with a tutorial so was following that. My object (movieclip) has the class 'Mountain' a...

E4X Add CDATA content

Basically I need to define a node name and its CDATA content using variables. var nodeName:String = "tag"; var nodeValue:String = "<non-escaped-content>"; Naively I thought this would work : var xml:XML = <doc><{nodeName}><![CDATA[{nodeValue}]]></{nodeName}> Outputs : <doc><tag><![CDATA[{nodeValue}]]></tag></doc> In a previous v...

as3 textarea component: disallow user to enter a line break

Hy I'm trying to prevent the user to enter any form of line breaks in a as3 textarea component. I tried using the restrict param of the textarea like this: foo.restrict = "^/\r\n//\n/" but i don't have any success. Hope anybody can help me out on the correct way to do this. thanks in advance Milan ...

Looping through childs in actionscript-3

How do you loop through all the childs in a DisplayObjectContainer in as3? I would like a syntax like this: for each(var displayObject:DisplayObject in displayObjectContainer ) { displayObject.x += 10; displayObject.y += 10; } ...

Displaying huge, scrollable graphics in Flex, part 2: BitmapData into an Image?

Clox answered my question of how to display huge graphics (e.g. greater than 8191 pixels). I have the code to copy parts of a huge loaded BitmapData to a target BitmapData that is just the size that I can display. I think I have set the scroll bars of an enclosing Canvas to show the size of the larger image and allow the user to scroll...

Can't make microphone work on Flex

Hi, A Adobe Flex issue... I'm attaching a microphone to a NetStream, but there is no mic activity. The privacy is set to Allow, the microphone.muted is false and the activity level is -1. Only when I open the flash settings, and open the Microphone tab, it starts to dispatch the Activity events, and it starts to stream the audio. Als...

Flex properties behave strangely when used in HTTPService

I'm writing a Flex app using REST requests and trying to avoid HTTP caching as well as synchronize client/server time. To this end I've created a timestamp property as such: // returns a timestamp corrected for server time private function get timestamp() : Number { return new Date().getTime() + clientClockAdjustMsec; } (The clien...

Sorting the Column properties of a datagrid in Flex

Hi , I am getting dates as string in the property of a datagrid column and I need to apply the sort functionality to compare these dates in the form of strings and then display these sorted dates as column headerdisplay text Does anybody have some idea on it . Thanks, Sudeep ...

flex3 menubar: bindings in "enabled" property

is this a bug or my fault? <mx:MenuBar width="100%" labelField="@label" itemClick="menuItemClickHandler(event)"> <mx:XMLList> <menuitem label="User" > <menuitem label="Log In" showDialog="LoginDialog" enabled="{model.FlowUserState == 0}" /> <menuitem label="Log Out" dispatchEvent="LogoutEvent" enabled="{model.FlowU...

Flex 3: How do I determine if a generic Object is actually a button?

I have this bit of code, and it's not working as I expected. btnContainer is a VBox that contains a ton of buttons (toggle=true); and I want to reset them to un-toggled at a certain point. for (var btn:Object in btnContainer.getChildren()){ if (btn.isPrototypeOf(mx.controls.Button)){ btn.selected = false; } } With the abo...

What is the equivilant of C#'s generic Dictionary in ActionScript 3?

I want to have a collection of objects, which will be of a class I created called Server. A Server has a string property which is it's IP address, as well as many other pieces of data and objects. I will have methods for adding and removing servers to this collection, and there will be a need to find a server by it's IP address occasio...