To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Reply
 
Thread Tools Search this Thread Display Modes
Old 10-10-2004, 07:57 PM   #1
Djali
Senior Member
 
Djali's Avatar
 
Join Date: Sep 2004
Location: Sweden, stockholm
Posts: 124
AS explanation

code:

on (release) {
gotoAndStop(2);
_root.po.attachMovie("gun2", "gun2", this.getNextHighestDepth(), {_x:30, _y:0});
}



I want to know what

this.getNextHighestDepth()

does in this code
Thanks!
__________________
Area restricted-
Tresspassers will be shot.
Survivors will be shot again...


http://www.geocities.com/legg3r
Djali is offline   Reply With Quote
Old 10-10-2004, 08:55 PM   #2
jbum
Senior Member
 
jbum's Avatar
 
Join Date: Feb 2004
Location: Los Angeles
Posts: 2,920
_root.po.attachMovie("gun2", "gun2", this.getNextHighestDepth(), {_x:30, _y:0});

the call attachMovie makes a new symbol by copying one from your library. The third argument (which getNextHighestDepth() is being used for) is the depth of the movie which controls layering. If two symbols are placed at the same depth, the second symbol obliterates the first one, so getNextHighestDepth() is used to insure that the symbol is placed on a unique depth, without obliterating any preexisting symbols, and it insures that the symbol is placed in front of any other symbols.

There's a possible mistake in the code, in that 'this' refers to the default timeline, but the movie is being attached to _root.po (which might not be the same thing). Since each timeline has it's own set of depths, you might want to use _root.po.getNextHighestDepth() instead of this.getNextHighestDepth().
__________________
jbum is offline   Reply With Quote
Old 10-11-2004, 05:17 AM   #3
Djali
Senior Member
 
Djali's Avatar
 
Join Date: Sep 2004
Location: Sweden, stockholm
Posts: 124
Thanks!
__________________
Area restricted-
Tresspassers will be shot.
Survivors will be shot again...


http://www.geocities.com/legg3r
Djali is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:45 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.