actionscript-3

Passing optional arguments (...rest) through to another method that takes optional arguments in AS3

Hi! I have a "format" method that works in a similar manner to the C# String.Format method, with the following signature: In a class named StringTools: /** * Formats a string, based on C# String.Format method. * @param raw A string with numbered tokens, such as "{0}, {1}" * @param rest Values that replace the numbered tokens in raw....

Adding an intro to a swf without access to the fla OR: differences between top-level and loaded swfs

I've got to (quickly!) add an intro to an existing flash masthead on a site that I've inherited. I don't have access to the source .fla's, so I approached the problem by putting the intro in a wrapper swf and loading the current masthead and adding it to the display list on Event.INIT. So far, so good. (Incidentally, the swfs are built...

misunderstanding buttons and textfields

I am a little confused. I made a button symbol and I put a textbox called "butLabel". this button is encapsulated into another movieclip called MainMenu. cbegin is the instance name I gave the button. If I trace like this.... trace(menu.cbegin); It recognizes cbegin is a button. but if I trace it like this trace(menu.cbegin.butLabel...

How do I ignore a Flash component's ADDED_TO_STAGE event during authoring time?

I've built a UIComponent in AS3. When I drag it onto the stage during authoring time, the ADDED_TO_STAGE event fires. I have an event handler, but it's really only meant to perform actions at runtime, not when I'm dropping the component onto the stage to design the layout. Is there any way to check to see if the component is "running" ...

Is it possible to catch a comboBoxes value before change with a change event

I am displaying a combo box in something of a WYSIWYG preview. I want the user to be able to click on the combo box and see the options inside, but I don't want them to be able to change the value. I tried using preventDefault() on the change event but it doesn't work. I don't want to disable it because I do want the user to be able to "...

Daisy chain movies together in Flash AS3

This is a 2 part question, I apologize. I know other developers must have workarounds for the 16,000 frame limit. How do I daisy chain movies together in Flash AS3? A. What is the best way to daisy chain movies together in Flash AS3. B. Can I treat it as an extended timeline beyond 16,000 frames Not by conventional thinking "Flashes ...

how to kill a setTimeout() function

I use the setTimeout() function through my application but when its time to garbage collect. the method still runs and calls on a function. How do I stop it from calling on a certain function. I tried setting it to null but it doesnt work ...

How to cut a "hole" inside a rectangular Sprite to see the Sprite underneath? (ActionScript 3)

Everytime I google this question I see confusing information about masks and blends, none of which seems to directly apply to what I think should be an easy thing... There are three Sprites involved here...the lowest layer sprite is pretty much a background. I want to overlay a translucent Sprite on top of the background and then I want...

Actionscript 3: Preventing mouse events *except* for a specific button/movieclip?

Is there a way to block mouse events except for a specific MovieClip or Sprite? i.e. I know that to prevent ALL mouse clicks, I can write something like: stage.addEventListener(MouseEvent.CLICK, onPreventClick, true, 0, true); ... private function onPreventClick(e:MouseEvent) { e.stopImmediatePropagation(); e.preventDefault(); } ...

Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.

I got this error and I am not sure what it's about. The last thing I remember doing is adding a clearInterval() method to clear some setTimeOut() intervals varibles. besides that I am not sure what it could be. Not asking for a solution. But if anyone know's any possibilities of what it could trigger that error, maybe that might help me ...

What Property Governs The Text Color Of Checkbox Text OnMouseOver In Flex?

Because the color of the background image in my application is very dark, and the Alpha is very low, when I hover my mouse over a checkbox, the text is scarcely visible. I've scoured the interwebz in vain for what property to set, either at design-time or in the MouseOver event for the checkbox and just can't figure out what property or...

How would I go about playing a sound object in reverse in Actionscript 3?

For a project I'm working on, it's necessary that I am able to play a sound object in reverse. How would I be able to do this in AS3? ...

AS3 Functions: is it possible to return a value inside of a loop?

I am trying to find the index from an array using a loop function, but I am getting an error: private function findMatch(matchValue:int):int { for (var i:int = 0; i < playersList.length; i++) { if (playersList[i].value + matchValue == levelTarget) { return i; } ...

Default variables with multiple developers.

This may be a weird question, but I'm wondering if there's any way to efficiently (perhaps using namespaces?) have different default variables in a class per developer in an actionscript project. I ask because we're currently working on a series of Flash games: 24 in total. Each is loaded by a shell container. The shell receives a flash ...

Sending Character Zero "\0" Over Binary Socket In Flex

This code doesn't send the trailing null byte. How do I send the trailing null? Socket.writeUTFBytes('Hello World'); Socket.flush(); Thanks in advance. :) ...

Fullscreen background image with Flex

I want to load an image into the background of my Flex app. However, I am wondering about a few things, and have a few contraints. I want it to be much like the way it's done with CSS. See this example of fullscreen background images with CSS. It is very important that there is no white-space (background colour) showing behind the imag...

Creating Flex components from XML

I have a XML and it has an attribute option or combo box, parsing that i need to create components in my flex dynamically. Viatropos has given a wonderful code, but i am not able to execute it... can anyone produce it... thanks ...

Handling complex navigation in Flex

Hi, I am building a complex Flex app, and now I am at the point where navigation becomes a problem. I make use of Viewstacks with a Menu Bar, but I am not sure how to clearly structure this. Depending on the logged in User and chosen Company by the user, he can see different pages. For now I restricted this hiding the appropriate butto...

ActionScript 3 constructor scope question

Hi everyone, out of curiosity I decided to experiment with the following in a Flex 4 project: public class MyGroup extends Group { public function MyGroup() { super(); var myLabel:Label = new Label(); myLabel.id = "myLabel"; myLabel.text = "My label!"; this.addElement(myLabel); ...

flex: add a form with 2 buttons into a hbox dinamically

let's say I have this function function Do(x:String){} How can I make so that each time this function is called, it will add a form into a hbox, and that form will have 2 buttons yes and no and put x into the text of a label. And when the user is going to click on Yes I need to trace(x) and remove the Form from the hbox ...