A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: onData

  1. #1
    Member
    Join Date
    Dec 2002
    Location
    Seattle
    Posts
    47

    onData

    stop();
    mc.onData = function() {
    if (mc.getBytesLoaded() >= mc.getBytesTotal()) {
    play();
    }
    };
    mc.loadMovie(String(newpage)+".swf");

    I am using this code to load a new page into a movie clip and check to see that it is entirely load befor playing, the reason i posted this is becuase it doesn't wor. please help

  2. #2
    go blues ! audas's Avatar
    Join Date
    Oct 2000
    Location
    london ,piccadily circus!
    Posts
    665
    onClipEvent(load){
    gotoAndPlay(2);
    }
    Make sure you have a blank nothing on the first frame.

    Do i take it you are loading something into a movie clip using target. I just think this is the worst thing that people can do, just use the infinite levels that are available to you.
    peace.

  3. #3
    Member
    Join Date
    Dec 2002
    Location
    Seattle
    Posts
    47
    onLoad is not called either

  4. #4
    go blues ! audas's Avatar
    Join Date
    Oct 2000
    Location
    london ,piccadily circus!
    Posts
    665
    um, have you put the code on the actual clip, or is it still on the time line?
    peace.

  5. #5
    Member
    Join Date
    Dec 2002
    Location
    Seattle
    Posts
    47
    timeline

  6. #6
    go blues ! audas's Avatar
    Join Date
    Oct 2000
    Location
    london ,piccadily circus!
    Posts
    665
    Well put the code on the clip itself.
    peace.

  7. #7
    Member
    Join Date
    Dec 2002
    Location
    Seattle
    Posts
    47
    i guess this post isn't very clear. i am hoping someone can tell me why the onData event is not called when the external swf is loaded. i know that the file is loading correctly, i can see it, but what i need is for a command to be called when it is loaded, and from my understanding onData is exicuted every time data is loaded either with a loadvars, or loadmovie command. i do not want to use loops, i don't want to put it in the movieclips timeline.

    any suggestions?

  8. #8
    go blues ! audas's Avatar
    Join Date
    Oct 2000
    Location
    london ,piccadily circus!
    Posts
    665
    LET ME EXPLAIN THIS CAREFULLY
    The data is a movie clip event. It will not work on a time line got it !
    same with (load)
    However both will solve you problem if you put them [B]ON THE CLIP[/B}

    As I have said twice now. You dont need a loop ??!!!?? Just a stop();


    If you want to use onData or onLoad you have to create either a LoadVars objest that is receiving variables, or an XML object. You are doing neither, you are loading in a movie clip, there fore may I suggest you implement the onClipEvent(load){ function as I have now said three times.
    Good luck, let me know when you have tried this. And Please try what I have said before you post again.


    P.s.
    The only way to check what has been loaded is to gain an idea of the file size of what is to be loaded through loading variables via PHP the php has checked the file size and returned it to flash flash then checks the amount loaded against this vairable, wow, I dont thinks so.
    peace.

  9. #9
    Member
    Join Date
    Dec 2002
    Location
    Seattle
    Posts
    47

    thx

    thank you for the detailed explanation, problem solved.

  10. #10
    go blues ! audas's Avatar
    Join Date
    Oct 2000
    Location
    london ,piccadily circus!
    Posts
    665
    Mark the thread resolved, down the bottom of the page.
    peace.

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