actionscript-3

FLEX: if statement if constructor argument is not provided

hi, is good practice to use if(source==null) in my costructor, to run code only if the costructor argument is provided ? package dataModels { import mx.collections.ArrayCollection; import dataModels.*; [Bindable] public class TagsListModel extends ArrayCollection{ public function TagsListModel( source:Ar...

Using the standard Flash AS3 scrollbar class

Flash has a scrollbar class, documented here: http://help.adobe.com/en_US/AS3LCR/Flash_10.0/fl/controls/ScrollBar.html However, besides listing functions and variables, there's no real explanation of how to hook an instance of this class to a textfield. Everything I've tried either ends up in errors or the scrollbar not showing. The d...

Paste event for a DisplayObjectContainer not registered in AS3

I have a display object container and I am trying to add a paste event to it. But the event is not being registered. The documentation at liveDocs mentions that classes that derive from Interactive objects can dispatch paste event but I dont understand why it wouldnt work for me. My app is not an AIR app, could it be a reason ? ...

Flash/As3 and Pixel-Bender: Realtime manipulation of video sound?

Hi! Using Pixel-Bender, it's possible to manipulate audio with effects, mixing channels etc. (http://www.kaourantin.net/2008/10/audio-mixing-with-pixel-bender.html). Could this technique somehow be applied to a video sound track? Jonas ...

Sphere to Rectangle collision detection in actionscript 3.0?

Hi, for the past two weeks I've been working on coming up with a collision detection system for my game in flash CS4. No matter what I try for some reason I just can't seem to do it, and I don't know how to fix it. This has never been an issue for me, I would even settle for basic rectangle to rectangle collision if I could, but no mat...

ScrollPane Component required in library even though it is not being used by Parent Movie

note: all as3 is written in CS4 and compiled for flash 10. I have a parent movie that loads a separate standalone SWF movie. This standalone movie happens to use the ScrollPane component (fl.containers.ScrollPane), and it runs correctly when launched on it's own. When I attempt to have a Parent movie load the standalone SWF, i receive ...

I would like to know to create a youtube like flash player

I basically want to embed a swf object and then feed different videos to it. Right now, I made a xml driven video player, however, I would have to create a new swf and xml list for each video I want to embed on my site. This is a real drag and pain. What is the procedure to make a universal player like youtube. FYI: I can't use flow play...

AS3: Synchronize Timer event to actual time?

I plan to use a timer event to fire every second (for a clock application). I may be wrong, but I assume that there will probably be a (very slight) sync issue with the actual system time. For example the timer event might fire when the actual system time milliseconds are at 500 instead of 0 (meaning the seconds will be partially 'ou...

e4x vs XPath: Which one to use when going with action script programming in Flex?

e4x programming extension is native to Actionscript and makes sense to use it over Xpath or any other DOM interfaces. I would like to know from flex community if they had any bad experiences like performance, etc, or any other gotchas. ...

Flex: How to change targeted id in a function?

In a Flex App I have some groups of checkboxes with similar ids At the definite moment only one group is accessible for checking group 10 id="chkBox101" id="chkBox102" id="chkBox103" group 20 id="chkBox201" id="chkBox202" id="chkBox203" group 30 id="chkBox301" id=...

Problem Loading AS2 swf into AS3 swf

I've been trying very hard to get an AS2 swf to load properly inside an AS3 swf - but to no avail ... The AS2 file (which is a rather big app referencing many external xml files etc.) works perfectly when launched in Flash Player. When trying to load the same file through an AS3 swf (using URLRequest and Loader classes), the file start...

Rijndael encryption from Action Script to C#

I am trying to share encryption between Action Script and C# My task is to decrypt the following message within C# f1ca22a365ba54c005c3eb599d84b19c354d26dcf475ab4be775b991ac97884791017b12471000def05bb77bfe9c3a97d44ef78c9449f12daf6e25b61ab1a281 It uses Rijndael encyption , ECB mode (electronic code book), Key: Pas5pr@se , 128 bit key s...

how to do collision detection for hollow(?) movieclips in flash AS3?

Hey everyone, I'm making small interactive games in flash to learn AS3, now I ran into a problem that I need some help with. I need to check the collision between the player and the wall which is normally simple using the hitTestObject function. But now I made a wall object totally surrounding the player with corridors and turn, a col...

in actionscript, how to tell whether the type of a number if Number or int or uint?

var n:Number = 1; trace("n is Number:" + (n is Number)); //true trace("n is int:" + (n is int)); //true trace("n is uint:" + (n is uint)); //true var m:Number = 1; trace("m is Number:" + (m is Number)); //true trace("m is int:" + (m is int)); //true trace("m is uint:" + (m is uint)); //true They all true! in actionscript, how to tell ...

Flex textarea control not updating properly.

I am writing a flex application that involves modifying a textarea very frequently. I have encountered issues with the textarea sometimes not displaying my modifications. The following actionscript code illustrates my problem: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absol...

I need to add a KeyboardEvent to a movie clip in Flash cs4 AS 3.0

I have a movieclip called keyCButton that I want to add a keyboardEvent ("C" Key) to. This will play an animation from frames 2-30 with a sound. I have watched a few tutorials but still haven't gotten the correct information to make it work. The following is my code. stage.addEventListener(KeyboardEvent.KEY_DOWN, cNote); function cNote(...

Canvas total width (visible width + hidden scrollable part)

It's probably a no brainer, but I've spent the last 40 minutes or so looking for it to no avial. I have a Canvas control with a fixed width and a horizontal scrollbar. I'm trying to find the actual width of the control. The .width (fixed width) + the part being revealed by the scrollbar. I tried explicitWidth, width + maxHorizontalScrol...

What are Adobe FLEX, Flash, ActionScript and their relationship to eachother, if any?

This is obviously a rookie question about Adobe technologies, but I am seeking a canonical answer to help me understand the adobe development stack. Thanks, -bn ...

AS3 notification for video first frame

When I play a video in Flash, fist, it starts buffering and then, when the buffer is full, it plays. While the buffer is filling, the associated Video object automatically displays the fist video frame. Is there a way to receive a notification when this frame is available ? Because I want to hide the video component until there is an im...

Registered Symbol Problem with Flash Mailto Link

The problem I'm having is an extra  Chracter being added before the ® symbol in the body of an email created from a mailto: link in flash. This only happens on the PC in MS Outlook Instead of: MasterCard®! It shows up as MasterCard®! The code in flash AS3: var req = new URLRequest("mailto:"); var variables = new URLVariables(); va...