actionscript-3

How to load swf file with event handlers in AS3?

stop(); var nc:NetConnection = new NetConnection(); nc.connect(null); var ns:NetStream = new NetStream(nc); var listener:Object = new Object(); listener.onMetaData = function(md:Object):void{}; listener.onPlayStatus = function(info : Object) : void { trace("onPlayStatus:" +info.code + " " + info.duration); if (info.code ==...

Create ipa for testing on device using iPhone Packager

Hi, i'm following Christian Cantrell guide for packaging AS3 application for iPhone, but i can't find a way to use the packager for creating an app for testing on device. I've tried with -target ipa-test and -target ipa-app-store but when i try to upload my app on the iPad, iTunes throws an error sayng that i'm not allowed. I've done a s...

AS3: Obscuring Loaded Resources

Hey guys, This is sort of a two part question. I'm building a flash image viewer to be a portable age-restricted module (violent video games). Basically, it will load any number of images from a CDN and require the user to enter their birthday before viewing it. Simple stuff. The problem is that, per company policy, we can't allow t...

Avoid ItemRenders Caching in a Spark List in Flex 4.

I have 2 Spark List with custom Item Renderers. I'm working on an application that enables users to grag these Item Renders from one List to the other. When one of these IR is dropped in a new position or in another List, I'm updating the dataproviders: remove the object from one list's dataprovider and adding it to other's dataprovider....

Flex/Flash Font Embedding...

I have a Flex 4 project that exists in a hybrid state of Flex/Flash AS3. I've declared a stylesheet in the base component of a Window: <fx:Style source="styles/styles.css" /> And all of my Flex components can display this font. The stylesheet looks like this: @font-face { src: url("../fonts/Whitney-Light-Pro.otf"); fontFamily...

Defining an XML format for a 2D array (Grid) of items

I need to define an XML format and then read it in ActionScript3, which will be storing: the number of rows and columns in a grid the horizontal and vertical spacing in pixels the size of each square in the grid in pixels an optional label for each square in the grid an optional hyperlink for each square in the grid The following is ...

How to make Papervision-DAE object animated by moving a part of vertices?

Hey, I have a static DAE model in my PV3D project, and want have the user to control a part of the vertices. For example, there's a human body DAE, I want to control all the z-value of the "head"'s vertices, so that this human becomes taller. Is there way to control a part of vertex group in DAE's schema? ...

Setting mask for sprite

So i have this sprite that is say arbitrarily 100 x 100 which is added to the stage. Now when content is added to this sprite the sprite expands automatically as it should. I dont want this to happen, what i want is to set a defined boundary i.e. 100 x 100, if too much content is added i can be able to scroll it. My problem is i cannot a...

Adding Audio To FLV in ActionScript

I have an FLV without sound, and a sound file without video. Can I combine them using Actionscript? Where should I start? ...

Flex / AS3 chart component to display normal distribution

Given a dataProvider with values ranging from 25 to 85: public var answers:ArrayCollection = new ArrayCollection([ {user_id: "A5", question_1: 35, question_2: 55}, {user_id: "A6", question_1: 40, question_2: 56}, {user_id: "A7", question_1: 45, question_2: 52}, {user_id: "A8", question_1: 43, question_2: 50} ]); How c...

How to detect a held key in a flash game?

What is the correct way to detect held keys in a flash game? For example, I want to know that the right arrow is held to move the player. Naive code: function handleKeyDown(event:KeyboardEvent) { held[event.keyCode] = true; } function handleKeyUp(event:KeyboardEvent) { held[event.keyCode] = false; } stage.addEventListener(Key...

How to use HTML Dom in adobe flex?

Can you use Html DOM in adobe flex to... 1) write/Auto fill in a form? 2) Read values in label? Textboxes? And use them in your program? ...

spark buttonbar ... change label on rollover

I've got a spark buttonbar w/ a dataprovider as follows: ' <s:ArrayCollection id="arr"> <s:source> <fx:Object label="Dave" addr="123 Main" /> <fx:Object label="Brenda" addr="456 Center" /> </s:source> </s:ArrayCollection> ' By default, the button's labels will be "Dave" and "Brenda", respectively. How can I dynamical...

AS3: Interfaces & Nonpublic Methods

Hey guys, I know that by definition AS3 interfaces must be public, and the methods within them must be implemented as public as well. I read this question and I suppose the answer is obvious if you want to have some classes choose whether or not to implement some methods, but have common base methods that must be implemented across all...

how to make a button go to a specific frame on the main timeline

how to make a button go to a specific frame on the main timeline my button called a play_btn and i want it to go to a specific frame on the main timeline ??? ...

Actionscript-3 prototype inheritance

Basically, I want to modify the constructor of the Object class. Since every class extends Object, I hope whenever any object of any class is instantiated, the modified function will be called. So I did this : Object.prototype.constructor = function (){ trace("it was called;"); }; and put a breakpoint on the...

AdvancedDataGrid (grouping) quick jump to row

Hi, I have a problem with the AdvancedDataGrid widget. When the dataProvider is an ArrayCollection (of arrays), the nth array (within the collection) is also the nth row within the grid, and I can jump and display the i-th row by scripting adg.selectedIndex = i; adg.scrollToIndex(i); now, when I add a Grouping, the dataProvider end...

Recursive Folder/Directory Copy with AS3 /Air

Hi All, Is there a way to recursively copy folders/directories with sub-directories and files in Actionscript / AIR ?? Thanks All. ...

AS3 MP3 Player Loads when opened locally, but doesn't show up at all on my server?!??!

sup everyone, I'm in my last quarter in college making my online portfolio and I just wanted to say that you guys have been a load of help the last week. Almost more so than my teachers... So I have some AS3 MP3 code that my teacher gave me a while ago and it loads perfectly when I load the site locally on my computer, but I uploaded th...

Most useful ActionScript packages / libraries for flash games

Most useful ActionScript packages / libraries for flash games ...