dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Basic Flash Questions

  1. #1
    Junior Member
    Join Date
    Jan 2004
    Posts
    27

    Basic Flash Questions

    I am somewhat student taught and self taught, mostly learning from tutorials and movies on this site and others. I have some questions that are pretty general that I am wondering about the best way to do things. Can anyone just clarify to me the best way to keep files sizes down and the best way to load .swf's into the main site. I have used loadmovienum and _root.loadmovie, but I am unclear on which one is better. Could someone explain that. If there are any other general things that are rule of thumb in creating flash sites, I would appreciate the advice or links to tutorials. Things I do work fine, but I know that I am not getting the best performance out of my files and there are things I am missing.

    Thanks
    thank you for all of your help

  2. #2
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    My preference is to use loadMovie to an empty target movie clip in the main movie. I have always found it much easier to target a swf loaded to an empty movie clip. There is a definate path direct to the object, through the instance name of the empty clip. Loading to a level with loadMovieNum is not quite the same, although it has it's uses. A level actually has no instance name, and I think this is a weak point with flash. ActionScript is an object oriented program language. Levels and Scenes are objects, but do not have instance names.

    Loading to a clip is easier to target and it's easier to position, since the loaded movie positions it's top left corner to the spot the empty clip is on. To position a movie loaded to a level, takes code in the movie or more code in the main movie to just position it. Every letter and space in actionscript adds one byte to the file. This can add ap fast.

    On the other hand, when a movie uses scenes, then you want to load a navigation movie or a sound to a level since levels are indepentant of scenes in the movie timeline. Using a level also allows you to load a swf or jpg with just code, which has it's uses. Still, for normal cases, loading to a target is better.

    I guess what I'm saying is that loadMovie and loadMovieNum are just tools, and you use the best tool for the particular job.

    Other things I do to keep file sizes down is to never use components. For a scroll bar, I make one and code it, rather than using a component. If I want the equivelant of a scroll pane, I make a scrolling movie clip. Components are huge and the must always load in the first frame, before the preloader even. That's about useless except for a Projector file on a CD. I load sounds from external movies rather than using attachSound with the sound in the library. Streaming sounds in an external swf add no bytes to the movie size.

    In the publish settings, I always set the compress movie option and usually set bitmap compression to 90% jpg. I always use buttons symbols over and over, rather than make new ones for individual purposes.

  3. #3
    Left-Handed Flash User mickbrit55's Avatar
    Join Date
    Nov 2003
    Location
    NJ USA
    Posts
    1,375
    Hiya

    To add to iask's previous post. There is a subtle difference between loadMovie and loadMovieNum. If you are loading into a level from the main timeline, something like ....


    loadMovie("myFile.swf", _level50);


    .. you have to be sure that the level already exists, otherwise the movie will load into the main timeline - _level0, deleting all the content there and replacing it with the new movie. The way around this is to use a string for the level. As in :


    loadMovie("myFile.swf", "_level50");


    Sometimes loadMovieNum is easier to use because it doesn't matter if the level doesn't exists prior to loading, the function creates it :


    loadMovieNum("myFile.swf", 50");


    Scenes are definitely NOT objects, which is why most people stay away from them and use frame labels instead.

    Other things that can make your files bigger are using bitmaps and having lots of gradients in the movie.

    Mick

  4. #4
    Junior Member
    Join Date
    Jan 2004
    Posts
    27
    thanks a lot for the tips
    thank you for all of your help

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