A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Question about root and this

  1. #1
    Member
    Join Date
    Jan 2003
    Posts
    63

    Question about root and this

    I tried a test by creating a button and on the button up event wrote the following script:

    trace(root.name)
    trace(this.name)

    I expected trace(root.name) to give me 'Movie 54' which it did. But I expected trace(this.name) to give me 'Button 4' but it also gave me 'Movie 54'.

    So what is the difference?

  2. #2
    Senior Member SirN's Avatar
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    142
    Simply put, you have copied and pasted the button and forgot to make it unique, or something... That's my princess in a pink playbox!

    I'm gonna need to check out the books I've gotten from my parents, they've been downloading it from Kazaa, did playbox sound like playboy or playbox like in boxing with that brittish Heavy weight Wch in Boxing (who's name I have forgotten)?

    Sorry if I did, and I wish that I helped you!

  3. #3
    Member
    Join Date
    Jan 2003
    Posts
    63
    Nope. The button is unique.

  4. #4
    Senior Member
    Join Date
    Jan 2003
    Posts
    169
    The root element points to the top level movie.

    That makes it useful in scripts like, for example, this one linked down here that's from another post which [sort of] demonstrates a load bar and plays the movie only when everything is loaded. This kind of thing needs more work, but it is efficient enough [for now] at 56K and works a little on broadband (cable/dsl). It's one of my attempts at a loading movie. In this example, it querys root for the bytes loaded vs. total bytes and sizes the fill of the load bar accordingly.

    http://crhs.ods.org/jeffrey/vocalalphabet3.html

    p.s. I won't be back on the forum until at least Friday afternoon and/or evening because I'll be away from any and all computer systems until then. And I'll be away Saturday because I'm going to be flying back home all day - I'm still on my vacation.

    EDIT:

    Oops, used function instead of element originally!
    Last edited by JSDvs9172; 05-26-2003 at 10:08 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center