actionscript-3

Actionscript Adding Custom Class To .fla

i'm missing something fundamental here. i have a very simple custom class that draws a circle and a checkbox, and only allows dragging of that circle sprite if the checkbox is checked. a checkbox component is manually added to the library in my .fla. from my .fla project's actions panel: var ball:DragBall = new DragBall(); addChild(b...

The fastest way to do a collection subtraction

I have two Sets. Set b is the subset of Set a. they're both very huge Sets. I want to subtract b from a , what's the best practice to do this common operation ? I've written to many codes like this , and I don't think it's efficient. what's your idea ? pseudo code : (this is not Java API) . for(int i = 0 ; i < a.size(); i++) { ...

How to get output of a webpage in ActionScript 3

Let's say this page www.example.com/mypage returns some html that I want to parse in Actionscript. How do i call this page from Actionscript while getting back the response in a string variable? ...

ActionScript instanceof for dynamic interface

interface If { ... } class Impl implements If { ... } function test(type:Class, obj) { return obj instanceof type; } test(If, new Impl()); The call to test on the last line returns false, but it should be true. How can I do this check right, with the requirement that it must be inside the function? Real code: public function...

Font not showing bullet points

I have embedded my font using the embed meta tag, along which the entire range of Unicode characters... here is my CustomTextField class: [Embed(source='../assets/fonts/Arial.ttf',fontName='CustomFont',fontWeight='regular', unicodeRange='U+0020-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E,U+0080-U+00FF,U+01...

What does the JS function 'postMessage()' do when called on an html object tag?

I was recently searching for a way to call the print function on a PDF I was displaying in adobe air. I solved this problem with a little help from this fellow, and by calling postMessage on my PDF like so: //this is the HTML I use to view my PDF <object id="PDFObj" data="test.pdf" type="application/pdf"/> ... //this actionscript live...

Trouble with error #1067: Implicit coercion of a value of type String to an unrelated type XML - AS3

Hi all, I'm building a small flash-based language translator. I am cross-referencing children of an XML parent node once the user types in a word or phrase into the text field. The result will be a translation of that word or phrase returned to the output_txt text field. The problem is, Flash gives me this error regarding the value typ...

Papervision3D: Making Object Appear Still When Moving Camera

I'd like to keep an object appear to remain in the same place while moving the camera. I'm using this script http://pv3d.org/2008/11/19/dragging-mouse-for-camera-orbit/ to orbit an object using a mouse drag. But I have an object in the scene that I would like to keep still. How to I do this? Thanks, Josh ...

How do I fix this warning in my mx:request tag?

I'm running an HTTPService with the following request: <mx:request xmlns=""> <view>{myViewStack.selectedChild.name}</view> </mx:request> The idea being to pass which child is selected on the viewstack to the php page, and then get that back so I can run some logic based on which child of the viewstack was selected at the time. Ev...

receive and pass values with XML, AS3

My example imports XML and has an object rotating on stage. The rotating object is called enemy corresponds to ENEMY in the XML. How do I set the rotation variable to receive values from XML? REASON It seems more difficult to set up variables using external data. I want to understand it better. rotation.fla //LOAD XML var myXML:XML;...

Flex AdvancedDataGrid with expandable nodes: possible to make the alternatingItemColors start fresh after each expandable node?

Say I have this AdvancedDataGrid: <mx:AdvancedDataGrid id="grid" height="384" width="100%" styleName="aStyleName" displayItemsExpanded="false" groupItemRenderer="SomeRenderer" draggableColumns="false" defaultLeafIcon="{null}" folderClosedIcon="{null}" folderOpenIcon="{null}"> <mx:columns> <!-- a bunch of AdvancedDatagridCol...

Scrollbar with Sprite and Rectangle won't move text, just the Rectangle it's painted on.

Warning: school assignment. For those of you still with me, I am tasked with making some scrollable content in Flash. Load in a TextFile using LoadURL(), then display it. To get the text, we've written our own class TextFieldExtended, which is basically just there to give the textfile location to the constructor and then have the class ...

FileReference: Loading a Windows-locked file

I'm using Flex in Flash Player 10 on Windows, using FileReference to load a file into memory, as below. My issue is that when a file is locked by Windows, my FileReference is not giving me any feedback that the file is inaccessible--it simply never dispatches any events after my calling load(). Does anyone have insight into how to tell...

Papervision3D: Line3D updating onEnterFrame

I'm updating the start and end points of a Line3D object in Papervision3D. The end result works fine but there seems to be a lag from when I move the objects and for the line to redraw in the right position. I'm using the following code: connectingLine.v0.x = startDisObj.sceneX; connectingLine.v0.y = startDisObj.sceneY; connectingLine.v...

Display character symbols in actionscript

I need to display a character symbol (Not alphanumeric, or on the keyword) textField.text = ???; I have the unicode for that char, how do I use it? ...

Display unicode character in Actionscript

I have the unicode for that char, how do I display it? 0x023D2A textField.text = ???; i have have the name of the character. can I reference it by name? ...

Set property of NumericStepper declared as UIComponent

I have a NumericStepper declared as a UIComponent: <![CDATA[ private var component:UIComponent; component = new NumericStepper(); ]]> I need to change the .maximum value of the NumericStepper but due to the UIComponent not having a .maximum property the following code fails with the error: 1119: Access of possibly undefined property m...

PNG file validation

Hi all, I have a Flash web app which displays user submitted PNG files. Files are uploaded to the server via some API prior to being displayed. I'd like to make sure no "bad" files are served to Flash, where "bad" is entirely unspecific. Is there a way to validate PNG files against the PNG specs (this would catch corrupted files)? Or an...

Actionscript Receiving Mouse Events For Lower Indexed And Partially Covered Display Objects?

i have 2 sprites on stage. bottomSprite is added to the display list first, followed by topSprite. topSprite partially covers bottomSprite. i've added an event listener to bottomSprite for MouseEvent.MOUSE_MOVED notifications to simply trace the mouseX and mouseY coordinates. however, the notification doesn't work for the parts of bo...

Error Referencing Externally loaded SWF

Hi, I'm loading an swf say "test.swf" which gets loaded in imageLoader , so I can get its content by : imageLoader.content So if I wanted one of the movieClips inside it I would do this : imageLoader.content.testMovie.transform.colorTransform = someTransformation; But when I do this, since the movie is not loaded the file is not ...