dcsimg
A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Preload A MC not swf! impossible then??????????

  1. #1
    Senior Member
    Join Date
    Jun 2004
    Posts
    209

    Preload A MC not swf! impossible then??????????

    Searched flashkit and actionscript for: "preload, buttons, mc, movieclip" etc, But I cannot find ONE topic on about 20 pages!! Ive searched google and nothing on it. I have spent hours searching, literally.

    What is more surprising is how come no one ever does it? Is it not possible?If you have a button on a page and want to load a MC how on earth are people doing it? are they just preloading it on entry instead? I see loads of websites that when you click a button something loads up and it looks like a MC.

    I cant understand why there is nothing on the internet about it. I have a border and shape made in flash with an image on, its an MC, I have lots of them I need to load them on a button press rather than load them all when the document starts with that preloader. Surely everyone does this sometime need to do this? Yet there's nothing about it anywhere that I can find? Why?

  2. #2
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,046
    Code:
    button_instance.onRelease=function(){
         placeholder_instance.loadMovie(location);
    };

  3. #3
    Senior Member
    Join Date
    Jun 2004
    Posts
    209
    erm? Button_instance is button name, placeholder name is a blank mc? location is name of the mc? Either way it doesnt work...

    Any chance of more help? I mean theres no preload there either

  4. #4
    Senior Member
    Join Date
    Jun 2004
    Posts
    209
    As usual masses of answers on this phenomina (sp?)

  5. #5
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    You load something external to the main swf.
    For instance an .mp3, a .jpg, an .swf

    If you load those external files into an empty MovieClip (target - using loadMovie()) you preload them by comparing that MovieClip.getBytesLoaded() to that MovieClip.getBytesTotal()


    If you load those external files into a _level (level - using loadMovieNum()) you preload them by comparing that _leveln.getBytesLoaded() to that _leveln.getBytesTotal()

    Those solutions cut the filesize of the main movie by as much external files you have.
    And this is what you see most of the time when you attempt to see a section and it says 'loading please wait'

    If you have internal objects, MovieClips, you would use another method like attachMovie() - That would not only 'not cut the filesize at all' but also those those will preload before anything else (even your main preloader) because they are attached, via linkage, and exported on the first frame. Last, they will preload like any other manually placed objects, with the rest of your main swf.


    gparis

  6. #6
    Senior Member
    Join Date
    Jun 2004
    Posts
    209
    So basically what you are saying is its not common practice to load up MCs themselves. Ok then I wont if there's no need/point. I just wanted to know what the the whole was about. Thanks

  7. #7
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    You do not load movieclips, they are not external documents, unless you paste them in a new .fla.

    gparis

  8. #8
    Senior Member
    Join Date
    Jun 2004
    Posts
    209
    Ok. Well I thought people did. I thought this because I thought if you have lots of files it will take a while to load on certain styles of websites. Its good to know anyway, thanks

  9. #9
    a small country village Trefor's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    328
    what you see are people loading swf files

  10. #10
    Member
    Join Date
    Mar 2004
    Location
    Argentina
    Posts
    43
    Hi.

    I´m interested on this subject and it´s exactly what I´m looking for right now.

    I want to load an MC with a button, in the coordinates I want. I don´t know much about actionscript and I´ve been trying lots of things without good results.

    If it´s of some use for you, I have an MC with 4 buttons. Each one has to load an MC containing a submenu that has to appear in certain coordinates.

    Thanks.

  11. #11
    Member
    Join Date
    Feb 2002
    Posts
    57
    Well, there is no way to JUST load the movie clip from an SWF, but you can load the whole thing but now show it (set the parent/container visibility to false) and then pull out the MC you want via the linkage property. As far as I know from the few thest that i did, the SWF that you load has to stay on the timeline for you to be able to reference the linkage items within its library. Also the linkage items have to be called on the same level. That is if you load the swf into myMCloader.loadhere, you can only call the attachMovieClip("something",1) within myMCloader.loadhere. I am not 100% certain on this, it was just what i got from the test i did for a previous project where i wanted to load a library of items and then use them later in the movie. It came out easier to just separate my library items into separate SWFs and load them separately.

    Hope that helps, probably not though
    : Nino ::-

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