03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

mc3_mc._focusrect = true;<br />

mc1_mc.onRelease = traceOnRelease;<br />

mc3_mc.onRelease = traceOnRelease;<br />

function traceOnRelease() {<br />

trace(this._name);<br />

}<br />

To test the SWF file in a browser window, select File > Publish Preview > HTML. To give the<br />

SWF focus, click it in the browser window <strong>and</strong> press Tab to focus each instance. You cannot<br />

execute code for this movie clip in the browser by pressing Enter or the Spacebar when<br />

_focusrect is disabled.<br />

You can also test your SWF file in the test environment. Select Control > Disable Keyboard<br />

Shortcuts in the test environment. This allows you to view the focus rectangle around the<br />

instances in the SWF file.<br />

See also<br />

_focusrect property, _focusrect (Button._focusrect property)<br />

_framesloaded (MovieClip._framesloaded property)<br />

public _framesloaded : Number [read-only]<br />

The number of frames that are loaded from a streaming SWF file. This property is useful for<br />

determining whether the contents of a specific frame, <strong>and</strong> all the frames before it, are loaded<br />

<strong>and</strong> are available locally in the browser. It is also useful for monitoring the downloading of<br />

large SWF files. For example, you might want to display a message to users indicating that the<br />

SWF file is loading until a specified frame in the SWF file has finished loading.<br />

Example<br />

The following example uses the _framesloaded property to start a SWF file when all the<br />

frames are loaded. If all the frames aren't loaded, the _xscale property of the bar_mc movie<br />

clip instance is increased proportionally to create a progress bar.<br />

Enter the following ActionScript in Frame 1 of the Timeline:<br />

var pctLoaded:Number = Math.round(this.getBytesLoaded()/<br />

this.getBytesTotal()*100);<br />

bar_mc._xscale = pctLoaded;<br />

Add the following code to Frame 2:<br />

if (this._framesloaded < this._totalframes) {<br />

this.gotoAndPlay(1);<br />

} else {<br />

424 ActionScript classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!