actionscript

How can I fill an actionscript 3 polygon with a solid color?

I'm building a map editor for a project and need to draw a hexagon and fill it with a solid color. I have the shape correct but for the life of me can't figure out how to fill it. I suspect it may be due to whether the thing is a Shape, Sprite or UIComponent. Here is what I have for the polygon itself: import com.Polygon; import mx.c...

Problem with actionscript 3 erasing drawing

I have a based image and some sprites on top of the basd image movieclip... Some of the sprites can be drawn by the user using graphics api in actionscript 3. I can draw things on the sprites but I can't create an eraser like brush that can remove part of the unwanted drawings. I try using Alpha but no it doesn't work I have googled ab...

FLVPlayBack: don't load flv until prompted to

Is it possible to configure FLVPlayback so that it does not auto-load the associated video file, but instead waits for a click on a "play" button to load and then play it? (I'm building a site that will have a player for a rather large video on its front page, and I'd rather not have the video downloaded unless/until the user asks to see...

How to erase an area in a BitmapData object?

Flex 3, ActionScript 3, Flash player 9. I have a picture in a BitmapData object. And an array of points. I nead to erase the part of the picture inside a polygon specified by the points. In other words, draw a polygon specified by the points and fill it with transparency. Any ideas on how it can be done? ...

actionscript: undefined public variables??

I have a class like this.. public class Doc { public function Doc():void {} public var myVar:Boolean; } How can I know if the value hold by myVar is the default false, or someone has assigned false to it ?!? Isn't there an undefined state? How can I achieve such a thing? ...

AS3, loading in a SWF as a custom type

Fundamental question here. Typically in AS3 you load in a SWF via the Loader, and what you get is some sort of pseudo MovieClip that is of type "Loader". Is there any holy way under the sun to cast this loaded SWF to a custom type that extends MovieClip and not Loader, assuming the SWF was published with a base class of the custom type?...

actionscript3 print array value on button rollover

Hello, I have created a flash map of the uk which is splti into regions, each region is a button that is fully visible when not rolled on and and fully transluscent when rolled over(to show the same region in a different color). What I need now is for when the button is rolled over I need it show the region name, I have an array of the ...

Flex compiler error: "please put definition in a package" for classes that ARE in a package

This is with Flexbuilder 3.2, Eclipse 3.3.2. I am moving my development environment to a new machine. Actionscript classes that compiled in the old environment now get a compile error: A file found in a source-path must have an externally visible definition. If a definition in the file is meant to be externally visible, please put the...

I want to insert a checkbox inside a accordion header in my Application (AIR).Can any one of you please help it out?

In my application i want checkbox on the accordion ,so is it possiable to set checkbox ? if it is possiable How can i identified child ? <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"> <mx:Accordion> <mx:headerRenderer> ...

Flash loads xml differently on Windows and Mac

Hi there I am loading an xml file using AS2.0. On Mac, all the elements load completely, but as soon as I run it on Windows, only the first element of type item loads. When I run it on Mac, the elements are loaded in and all item's are separate buttons. When I run it on Windows, only one button appears and its name is ch1. Virgin Group ...

Main Flash swf won't work once uploaded to server

Hi I have a 1 frame main SWF. In the first frame I include codeAS2.as like so: #include "codeAS2.as" (sorry, might sound primitive) When I test the movie in Flash CS4, everything works fine, it loads all the data from the XML file menu.xml which is in the same folder. Using the Simulate Download function from Flash, it also runs fine,...

Flex: Binding to an MXML-esque "binding string" in action script?

Is it possible to specify MXML-esque "binding strings" in ActionScript? For example, I want to be able to do something like: MXMLBinding(this, "first_item", this, "{myArrayCollection.getItemAt(0)"); MXMLBinding(this, ["nameLbl", "text"], this, "Name: {somePerson.first} {somePerson.last}"); Edit: thanks for the...

Flash button/symbol...

Hiya. I'm new to Flash so my terminology might not be accurate so please bare with me. I've created a button (symbol), and added a OVER state, which covers a bigger boundary than the UP state. However when I add the symbol/button to my stage, the roll over activates on any area covered by the over state, where I only really need it cov...

get the index of first element to mach a condition in an XMLListCollection Object.

I have an XMLListCollection object that contains items with an ID property. I want to find one particular item by id and then get it's index in the collection. This is done to be able to tell the comboBox (whose dataProvider is the XMLListCollection) the index of the item to display. ...

Flash and Flex workflow using a SWC

Ill try to explain the best i can :) I want to use the strengths of both Flex and Flash in an upcoming project. Doing the graphical related stuff in Flash and all the coding in Flex. What i want to do is create a layout in flash making classes as you would normally by creating symbols and exporting them for actionscript etc. Then i wan...

Do Events break Interfaces?

Note: in this question, I am talking about formal Interfaces (e.g. public interface IButton {...} ). I'm an Actionscript developer, but I suspect my question will resonate in many languages that allow both formal Interfaces and Events. I love Interfaces. I love the separation between interface and implementation. (I wish Actionscript...

Custom (simple) AS3 Class code not executing entirely

Hi there, This problem is probably very simple to solve but it is not clear to me. It may simply be that I am doing something incorrectly. I have studied OOP and AS3 for quite a few hours so I am familiar with the concepts but not the flow. This is a project that I put together in order to reinforce what I have been studying. The goal ...

RegEx to match comma separated numbers with optional decimal part

I've a regex that matches comma separated numbers with an optional two digit decimal part in a given multiline text. /(?<=\s|^)\d{1,3}(,\d{3})*(\.\d{2})?(?=\s|$)/m It matches strings like 1, 12, 12.34, 12,345.67 etc successfully. How can I modify it to match a number with only the decimal part like .23? EDIT: Just to clarify - I woul...

How to find an ArrayCollection item with a specific property value?

I have some XML structures like this: var struct:XML = <mh> <mi id="1" stuff="whatever"/> <mi id="2" stuff="whatever"/> <mi id="3" stuff="whatever"/> </mh>; I know I can access a subnode by "id", in this way: var stuff:Object = struct.(hasOwnProperty('@id') && @id == '2').@stuff; Now I have some similar ArrayCollection struct...

SWF file not reliably loading from server

I have created an application using Adobe Flex. I took all the files from the 'bin-release' folder and put it on the server. Then when someone connected to the server through http it is forwarded to the "index.htm". The "index.htm" page is the HTML page created automagically by Adobe Flex during compile time, I just renamed it to that...