SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard Wolf_22's Avatar
    Join Date
    Jul 2005
    Posts
    1,714
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Water tutorial and misc. questions...

    I'm using Macromedia (at the time) Flash 8 Professional and have been working on a tutorial I found to try and make realistic looking water since I'm pretty new to ActionScript and the like. While most of it seems relatively simple, I have a couple basic questions that I have been having a hard time understanding...

    1.) Why is this following code used?
    Code:
    p = getBytesTotal()/100;
    mc.gotoAndStop(int(getBytesLoaded()/p));
    if (getBytesLoaded()>=getBytesTotal()) {
    	gotoAndPlay("Scene 1", 1);
    }
    This code is in a "preloader scene" and while I know it is a basic preloader that tells the movie to move on to "Scene 1", frame 1, the thing I lack understanding of is the general functionality of it. How does it work? The getBytesTotal() counts how many bytes there are in the movie file, divides that number by 100. I guess it's making a measure here and the using this measure as a conditional down the code? ...I just don't get the comparative memory thing in this...

    2.) mc.gotoAndStop() - What does "mc" represent? I know it means "movie clip", but is "mc" some sort of reserved word for this specific use? How does FLASH know we mean "movie clip"? I have seen various other tutorials write out "MovieClip" instead of using "mc". Does it really matter which is used???

    3.) The ActionScript Dictionary refers to "MovieClip object" often. When it refers to this, is it really referring to the actual movie in it's entirety?

    4.) (Last Question): In my FLASH 8 interface, I have the status-quo timeline, stage, ActionScript script editor and to the left of the ActionScript script editor and to the right of the "Tools", there is some sort of other "miscellaneous" pane that has the scenes and other things listed in an collapsible lists. What pane is this? When I right-click on any of the list elements, nothing happens. All I can do is extend the little '+' or '-' signs next to the items...

  2. #2
    SitePoint Wizard jim_morrison3's Avatar
    Join Date
    Apr 2004
    Location
    UK
    Posts
    2,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Wolf_22
    1.) Why is this following code used?
    As you already mentioned, its a preloader code, getBytesLoaded() and getBytesTotal aer flash functions that return the total bytes of the application that has been loaded and the size of the entire application respectively.



    Quote Originally Posted by Wolf_22
    2.) mc.gotoAndStop() - What does "mc" represent? I know it means "movie clip", but is "mc" some sort of reserved word for this specific use? How does FLASH know we mean "movie clip"? I have seen various other tutorials write out "MovieClip" instead of using "mc". Does it really matter which is used???
    mc here refers to the instance name of a movieclip. You need to check your flash stage for the movieclips and check their instance name in the left hand side of the Properties Panel.

    Quote Originally Posted by Wolf_22
    3.) The ActionScript Dictionary refers to "MovieClip object" often. When it refers to this, is it really referring to the actual movie in it's entirety?
    MovieClip is a class available in Flash all the movie clips you create on stage are objects of the MovieClip class.
    Good Luck!
    There are things known and Things unknown
    And in between are the Doors.
    I love hand Coding.


Bookmarks

Posting Permissions

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