flash-cs5

Why to use Singleton patern?

Hey, So.. I can't understand why should I even use the Singleton pattern in ActionScript 3. Can anyone explain me this? Maybe I just don't understand the purpose of it. I mean how it differs from other patterns? How it works? I checked the PureMVC source and it's full of Singletons. Why are they using them in the View, Module, Controlle...

Button with dynamic text in Flash CS5

I'm new to Flash Pro programming, and am trying to create a button-type symbol where I can set the label. The problems I'm running into are as follows. If I make the symbol type=Button, I can't add ActionScripts in the frames and/or access any subcomponents? Why is this so? If I make the symbol type=MovieClip, I can add ActionScript...

Hiding Flash timeline layers for preview/publish

When I'm in design mode in Flash Pro, I can selectively hide layers. However, whenever I run the movie for testing the hidden layer inevitably shows up. Frustrating, as I want to be able to test several different layers and not have them all appear. What am I doing wrong? ...

How to paste object into all frames of Flash timeline

How do I paste an object into all frames of a timeline layer in Flash CS5? ...

Adding Actions to Button Symbol frames in Flash CS5

For some reason I can't add ActionScript actions to a timeline frame within a Button Symbol, like I normally would with MovieClip symbols or on the stage. The Actions panel shows this message: "In ActionScript 3.0, code cannot be placed directly on objects. Please select a frame..." even though I definetely have a frame selected! An...

Constraining/clipping symbol boundaries in Flash CS5

I want to create a MovieClip symbol of a certain width and height, but with content that extends outside its boundaries, with the option to have the external content be clipped/hidden or visible. In Flex, the solution would be to create a group with .clipAndEnableScrolling = true. Is there a way to do this in Flash CS5, or will the s...

Edit item in all frames of a timeline layer in Flash CS5

I'm confused as to how Flash CS5 treats symbol instances across different frames in a given layer; If I add an object to a layer, and then add a keyframe to the existing frame set, are there now two instances of the object, one for each frame? When I change the color of the instance in the first key frame, the second keyframes instance ...

How to check if mouse is over a symbol instance with ActionScript 3 in Flash

How does one check if mouse is over a symbol instance using ActionScript 3 / Flash CS5? ...

Efficient event listening in ActionScript 3

Hey, I have a map of items and I need to know when a mouse moves over the item. Should I add a event listener for mouse over and mouse out to each item (there may be a lot) or I should add mouse over and mouse out listeners to whole container and do some checking to detect whether the target has item on it or not? In the second way it ...

Actionscript 3 NetStream immediately paused does not get metadata

I am writing a basic video player in Flash CS5 and Actionscript 3. For this basic player, I attach my NetStream to my NetConnection, then call the stream's .play() method to begin loading. Although I want the metadata and for the stream to begin buffering, I do not wish to start playing right away, so I immediately call the stream's .p...

Flash dynamic TLF text mixes fonts together- very weird

I'm using Flash CS5's new Text Layout Framework (TLF) for the first time. Whenever I set the TLF text dynamically through actionscript, the resulting text renders with multiple fonts! (The same text set statically doesn't have any issues) Example: I can understand if, when a client machine lacks a given font, Flash would choose a ...

How to see all elements of current symbol in Flash CS5

I'm dealing with multiple hard to find/small/transparent elements within nested MovieClips in Flash CS5. Is there no outline window where I can get to an element through a tree format vs having to look around on the stage? The closest thing I've found is the Movie Explorer window, but it doesn't go any deeper than the scene level? But...

assign value of form field as URL parameter

I need to take a user-entered value from a form-field and append it as a URL parameter when the user hits {ENTER} or clicks the submit button. I'm new to DreamWeaver CS5, and I have a project that I'm getting pressure to complete. ...

Why my Flash button disappears (Flash Pro.)?

I'm following this tutorial on Flash Pro CS4: http://www.baycongroup.com/flashCS4/09_flashCS4.html I have a button. I pressed CTRL + E in this button, I clicked the 'hit' frame on the 'Text' layer and I created a new frame going in 'Insert > Timeline > frame' as said in the turorial. Like ins the image below. But after I create a new ...

What's wrong with my flashvars code?

I'm trying to read flashvars into my flash file by modifying the standard HTML published out of Flash CS5. The following isn't working: HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> ...

Understanding Flash CS5 embed code

When I publish out of Flash CS5 it produces html <object> tags but no <embed> tags. I thought tags were required for certain non-IE browsers? Example: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> ...

Propagate custom event to Parent

I have got a custom event set up (see below), but when I listen for the event in my main class, and it gets dispatched from the child class, it never gets captured. TRIED: this.b.addEventHandler(GameLaunchEvent.GAME_LAUNCH_EVENT, this.eventHandler) package com.thom.events { import flash.display.MovieClip; import flash.events...

Reusing library items across Flash projects

What's the best way to re-use library elements across Flash projects. For instance, I created a loading indicator Movie Clip that I want to re-use- Should I export it as a SWF, and then re-import it into other projects? (For some reason when I try this, the imported clip shows up but does not play in the new project? Why would this b...

Changing animation on a movieclip on a key press is failing.

So far, I have the following Actionscript 2.0 code - I'm trying to make the animation change on a key press then loop to simulate running. But it sticks on the gotoAndPlay(9) trigger, regardless of what frame the animation is on. onClipEvent(keyDown) { if (Key.isDown(Key.RIGHT)) { this._x += 5; ...

Arrange (z) order of objects in Flash with ActionScript 3?

Is it possible to arrange (z) order of objects in Flash with ActionScript 3? e.g. I have 3 symbol instances on a given layer, and I want to perform the equivalent of 'Bring to Front', 'Bring Forward', and/or target a certain z position. ...