Url (Button._Url Property) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

Example
The following example demonstrates how to track two buttons as a menu. Place two button
instances called
one_btn
Timeline:
var one_btn:Button;
var two_btn:Button;
one_btn.trackAsMenu = true;
two_btn.trackAsMenu = true
one_btn.onRelease = function() {
trace("clicked one_btn");
};
two_btn.onRelease = function() {
trace("clicked two_btn");
};
To test the SWF file, click the Stage over
it over
. Then try commenting out the two lines of ActionScript that contain
two_btn
and test the SWF file again to see the difference in button behavior.
trackAsMenu
See also
trackAsMenu (MovieClip.trackAsMenu property)

_url (Button._url property)

public _url :
String
Retrieves the URL of the SWF file that created the button.
Availability: ActionScript 1.0; Flash Lite 2.0
Example
Create two button instances on the Stage called
ActionScript in Frame 1 of the Timeline:
var one_btn:Button;
var two_btn:Button;
this.createTextField("output_txt", 999, 0, 0, 100, 22);
output_txt.autoSize = true;
one_btn.onRelease = function() {
trace("clicked one_btn");
trace(this._url);
};
two_btn.onRelease = function() {
trace("clicked "+this._name);
var url_array:Array = this._url.split("/");
var my_str:String = String(url_array.pop());
output_txt.text = unescape(my_str);
};
292
ActionScript classes
and
on the stage. Enter the following ActionScript in the
two_btn
one_btn
[read-only]
, hold the mouse button down, and release
and
one_btn
two_btn
. Enter the following

Advertisement

Table of Contents
loading

Table of Contents