actionscript-3

The supplied DisplayObject must be a child of the caller

Hello. I am a newbie, and I have seached and tried for weeks on this, and I cannot get the grip on this. The simple code below gives the "The supplied DisplayObject must be a child of the caller" error. var square = new squareObj; addChild(square); addEventListener(Event.ENTER_FRAME, removeSquare); function removeSquare(evt:Event):void...

flex 4 release changes to application are not showing up.

I just took over a clients flex project and I can't get the app to reflect even a simple trace statement. Before I took over, the project was last successfully built using the Flash Builder Beta 2 environment/sdk. I have the latest release version of Flash Builder 4. Upon importing the project into FB4, I got a ton of errors. Most of t...

[AS3] htmlText not showing bold or italics font

So I have a MovieClip asset with a dynamic textfield sitting inside of it. I export my .fla as a .swc to use within Flash Builder 4, and create instances of the asset with code, populating the text dynamically from XML. My issue is that even though I have htmlText enabled, bold and italics tags don't appear to be working. I have a fee...

Explicitly typing variables causes compiler to think an instance of a builtin type doesn't have a property, which it does

I narrowed the causes of an AS3 compiler error 1119 down to code that looks similar to this: var test_inst:Number = 2.953; trace(test_inst); trace(test_inst.constructor); I get the error "1119: Access of possibly undefined property constructor through a reference with static type Number." Now if I omit the variable's type, I don't ge...

Easiest way to store long term variables with AS3

What's the easiest way to store a simple numeric variable on my server and then have a Flash application also hosted on the server read/write the variable? I've seen various xml solutions, but they look too complex for such a simple job. Is there a way to just read/write a simple text file with just AS3 and no middle-ware? ...

Loading Flash / Flex Applications in another AIR Application

Hi there, i'm loading a Flex Application in my AIR App and i'm using the childSandboxBridge and parentSandboxBridge to communicate between those two. Works like a charm. But i've tried to load a Flash Application (the main Class extends Sprite, not Application) and therefore i get a SecurityError when trying to set the childSandboxBrid...

Flex SDK missing fundamental things

All of a sudden Flash Builder 4 is missing all kinds of fundamental things and is generating incorrect errors. I've had the same issue yesterday, where I fixed it by downloading a new Flex SDK and importing that into FB. I did this again, but this time it fixed nothing. I don't think it's something I did, like removing critical refere...

How do I get flashvars in Firefox using object embed tag only to work?

I am trying to generate an <object> tag only embed code and cannot get Firefox to pass Flash along the FlashVars values. This seems to work everyplace else that I've tried it but fails in Firefox. Here is a sample of the embed that I'm using: <object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-44455354000...

how to obtain fillColor from mx:LegendItem

I need to get the fillcolor from a legendItem, howerver doing lItem.getStyle("fill") returns a different color than the actual legendItem marker color. Any pointers on what am I doing wrong here? ...

flex override public function set data

Hi, I have a datagrid with itemRenderer in datagridcolumn as my custom component(c1). I am getting the dataprovider data in custom component by overriding the set data function, it is fine. But now my custom component(c1) is also having another custom component(c2). Now the doubt is - how to get the dataprovider data in c2 component? ...

Add child to scene from within a class.

Hi, I'm new to flash in general and have been writing a program with two classes that extend MovieClip (Stems and Star). I need to create a new Stems object as a child of the scene when the user stops dragging a Star object, but do not know how to reference the scene from within the Star class's code. I've tried passing the scene into...

flex datagrid re-assign dataprovider

Hi, I am working on a datagrid with custom itemRenderer & [Bindable]xmllist as dataprovider. Now the changes done in xmllist are not reflected on datagrid UI until unless I re-assign the dataprovider as the same xmllist. As the dataprovider is Bindable so re-assigning is not required. But it was not working so I re-assigned the xmlli...

How can I sort a Flash Actionscript 3 Tilelist based on columns and not rows?

Hi all - I have a Flash Tilelist component (not flex) and have set it up so that 4 rows of 3 tiles each are visible before scrolling. I should note that I'm using a horizontal layout because I need a horizontal scrollbar. I realize using a vertical layout would sort the way I want but gives a vertical scrollbar. The problem I'm encount...

repeat text animation, as3

Hi, My text animation works perfectly, but doesn't repeat. How do I get this to repeat? Sorry I don't know Flash that well, but I just want this to play over and over. Thanks. var myArray:Array = ["Big", "Holiday", "Sale", "Buy", "Now", ...

How to properly set button phase after dragging over button?

I have a class (mxml) that extends Button while implementing drag/drop support. When I drag one of them onto another, the drag receiver stays stuck in its 'over' phase until I click on it (As if something about DragManager.acceptDragDrop is preventing the MouseEvent from getting to button) Is there a way to make a button re-evaluate it...

Create and define Vector

I'm looking for method to create Vector and push some values without defining variable Vector. For example: I have function: public function bla(data:Vector.<Object>):void { ... } this function expects Vector as parameter. I can pass parameters this way var newVector:Vector.<Object> = new Vector.<Object>(); newVector.push("bla1"); n...

Integrating virtual keyboard on a HP TouchSmart with an Adobe AIR app

Hi, Does anyone know if it's possible to integrate the ToushSmart's virtual keyboard with an Adobe AIR application? In most programs (Internet Explorer, Firefox, etc), when a user touches a text field a little keyboard icon automatically pops up which, when pressed, will bring up the virtual keyboard. However, this doesn't happen when ...

Scrolling through list element causes text elements to scroll as well

I'm using a list element with variableRowHeight and word-wrap set to true like in the example below: http://blog.flexexamples.com/2007/10/27/creating-multi-line-list-rows-with-variable-row-heights/ When I scroll through the list with a mouse scrollwheel the text in the listItems also scroll. I know that this is to do with the height of...

Security sandbox violation when connecting to Socket from flex

Hi, I am using a Socket (not xmlSocket) connection between flex applications and the server pushing messages. Now, when I connect from the local machine to the server everything is working file and running, connection is succesful and I get data back and forth. When I upload the application (flex) to the server and run it from there, ...

AS3 Socket Error

New to AS3 and I get this error: 1084: Syntax error: expecting rightbrace before colon. Conn:Socket: null, var mc:Object = { Conn:Socket: null, Username:String: "fu", }; function zSock(host:String = "70.32.72.134", port:String "70.32.72.134"):void { mc.Conn = new Socket(host, port); mc.Conn.addEventListener(Event.CONNEC...