A Flash Developer Resource Site

Results 1 to 18 of 18

Thread: another preloader problem

Hybrid View

  1. #1
    I tried... dbarbarian's Avatar
    Join Date
    Aug 2003
    Location
    Berkeley, California, USA
    Posts
    678

    another preloader problem

    I have a movie clip right now with a ton of high quality bitmaps in there. when i preview the swf, it play them at a lower fps then desired. would preloading the frames first help, even though i'm going to view it in swf?
    if so, i want it to preload on frame 2 of the mc, and when it is done loading, play like, say, frame 5. there are like 50 frames total.
    Thanks for your help.

  2. #2
    Senior Member
    Join Date
    Nov 2002
    Posts
    135
    so you want a preloader,

    in the starting frame use a stop()
    and put this in a movie or anyplace else

    if (_root.getBytesTotal() == _root.getBytesLoaded()) {
    _root.gotoAndPlay(2);
    }

    oh wait, does it play slow off of your computer or off the net?
    either way a preloader is good to have.

  3. #3
    I tried... dbarbarian's Avatar
    Join Date
    Aug 2003
    Location
    Berkeley, California, USA
    Posts
    678
    plays slow off the computer.
    i know how to do a regular preloader where you load the whole movie, but is there a way to just load the frames in the movie clip, when it is frame 2 or sometihng of that movie clip.

  4. #4
    Senior Member
    Join Date
    Nov 2002
    Posts
    135
    im not sure what you mean, have the preloader start on frame 2 or only check the size of frame 2?

    but if it runs slow off the computer a preloader wont make it faster, either your computer is slow or the swf is too computation heavy, attach the fla and i'll see

  5. #5
    I tried... dbarbarian's Avatar
    Join Date
    Aug 2003
    Location
    Berkeley, California, USA
    Posts
    678
    i guess the computation is too heavy, cause i have a very fast comp.
    the swf file is huge (7 megs).
    what happens is that when i run it once, the movie clip lags a lot. but when i click and run the movie clip again, it gets a lot better, so i guess a preloader won't work. thanks for your help.

  6. #6
    I tried... dbarbarian's Avatar
    Join Date
    Aug 2003
    Location
    Berkeley, California, USA
    Posts
    678
    i have a different question though. in that movie clip, i have 29 layers, all have a button on them, when one of the button is on the "over" key frame, it is enlarged. the problem is that some of the buttons are in lower layers, so it shows that button behind the other ones. i can't figure out how to use action script to change the layer, so the button your mouse is over, will always be on the top layer.
    thanks

  7. #7
    Senior Member
    Join Date
    Nov 2002
    Posts
    135
    movie.swapDepths(#)
    might wanna put those on the same layer unless you need to keep them seperate

  8. #8
    I tried... dbarbarian's Avatar
    Join Date
    Aug 2003
    Location
    Berkeley, California, USA
    Posts
    678
    what does the the # in the () do. higher=higher layer, or vice versa.
    and where do you put the code?

  9. #9
    Senior Member
    Join Date
    Nov 2002
    Posts
    135
    well on the button

    on(rollOver){
    this.swapDepths(100)
    }

    EDIT: it only works on movie clips
    and youll need an array
    Last edited by fidodo; 08-24-2003 at 10:06 PM.

  10. #10
    I tried... dbarbarian's Avatar
    Join Date
    Aug 2003
    Location
    Berkeley, California, USA
    Posts
    678
    doesnt seem to work. hmmm

    do you possibly have a fla of a working version with that code?

  11. #11
    I tried... dbarbarian's Avatar
    Join Date
    Aug 2003
    Location
    Berkeley, California, USA
    Posts
    678
    there is a movie clip on the "over" key frame.
    what's an array?

  12. #12
    Senior Member
    Join Date
    Nov 2002
    Posts
    135
    yeah it only works with movie clips , im not sure what the button varient would be
    not to mention you need a self organising array which isn't so hard

    EDIT: an Array is a varible with differnt values inside it, and the variables inside are organised by number, the reason we have them is so we can organise all simular values, so there all related.
    Last edited by fidodo; 08-24-2003 at 10:13 PM.

  13. #13
    I tried... dbarbarian's Avatar
    Join Date
    Aug 2003
    Location
    Berkeley, California, USA
    Posts
    678
    how would i make an array?
    then i can just put that button in mc, nad put the code on that.

  14. #14
    I tried... dbarbarian's Avatar
    Join Date
    Aug 2003
    Location
    Berkeley, California, USA
    Posts
    678
    nevermind, i found a better way of doing it using a new layer.
    thanks for your help.

  15. #15
    Senior Member
    Join Date
    Nov 2002
    Posts
    135
    could i see? im curious

  16. #16
    I tried... dbarbarian's Avatar
    Join Date
    Aug 2003
    Location
    Berkeley, California, USA
    Posts
    678
    nope, didnt work.
    oh well, whatever. lol

  17. #17
    Senior Member
    Join Date
    Nov 2002
    Posts
    135
    i think i figured it out, i'll attach the test file.

    it'll require a little bit of work to apply.

    you need to put all the buttons in movies with the names button0-buttonx
    and the script that goes in the movie button you need to change the part where it says
    _root.control.depthtag[x] = _root.control.depthtag.length;
    and change the x to the number after the button instance name, so if the buttons called button7 change the code to
    _root.control.depthtag[7] = _root.control.depthtag.length;

    hope it works
    Attached Files Attached Files
    Last edited by fidodo; 08-25-2003 at 12:02 AM.

  18. #18
    I tried... dbarbarian's Avatar
    Join Date
    Aug 2003
    Location
    Berkeley, California, USA
    Posts
    678
    thanks for helping.
    but i did find something else that was quite simple.
    just put
    on (rollOver) {
    this.swapDepths(100);
    on all of the movie cilps that are on the same layer.
    and i just made them buttons using actionscript.
    onClipEvent (mouseDown) {
    if (this.depth == 100) {
    if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
    _root.wallpaper.realwallpapers.gotoAndPlay("cancer ");
    }
    }
    }

    thanks

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