dcsimg
A Flash Developer Resource Site

Page 2 of 4 FirstFirst 1234 LastLast
Results 21 to 40 of 70

Thread: actionscript timer?

  1. #21
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    Hi oldnewbie,

    I've just been reading through your posts properly now that I'm at work, cause I was hurrying at the weekend to save my mobile bill.

    I've had a look at your friends site (now I'm not on a 28k modem!), and its the same idea I want, appart from mine would be a vertical swipe rather than horizontal.

    The "i" variable before was 14 for the 14 frames it took for the bar to come down, rather that 14 frames to load the next swf.
    I did have the bar set up as 1 file, but couldn't get it to work with my weird methods, so thought I'd try it as 2!

    I will probably add a home button in later, but if you can just show me how to set up 1 button, then I can sort the rest out myself later.

    I've finished or almost finished my What We Do section, which uses a horizontal scrolling line. It seems to work fine, but occassionally the images randomly move? I don't know why, cause they look fine and in the same place on my timeline.
    Any reason for this? The file is attached.

    Thanks again for your help
    Attached Files Attached Files

  2. #22
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Ok! Had a look at your file. For picture shifting, it seems you're using tweens, so just set your settings to 1% & 99% rather than 0% and 100%, that usually does the trick. If that doesn't work see this for other solutions:

    http://www.macromedia.com/support/fl...maps_shift.htm

    Still working on this... Can I put this "what we do" .swf, online to load it up in your main interface and then post the link for the .fla here for the benefit of others, or do you prefer I not do that?

  3. #23
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    yeah, stick it online.
    At least that'll save you the hassle of going through all this again, then next time some other newbie wants to do it!!

    I'll try playing about with the images, and hopefully one of the solutions on that site will stop my images jumping!

    Cheers
    Last edited by P3EPS; 02-10-2003 at 09:35 AM.

  4. #24
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    Sorry... I know I said No hurry, but the guy who I'm doing this site for is really on my case at the moment!
    I don't suppose you've had a chance to sort it out yet?
    I HATE asking, but I'm getting my ass fried just now!

    Thanks alot

  5. #25
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Nobody's frying mine! I know this will work! I've done it many times before. Just trying to do it right adapting it to your movie. Can't you work on your other content movies? And what about a "Home" page at the beginning, would you add another button?

    Did you solve your shifting problems?

    Give me an hour... Otherwise I do have a Paypal account!

  6. #26
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Here's your movie!

    http://odin.prohosting.com/~oldnew/flashtesting/kss.htm

    Whatwedo and Contact are the only buttons working.


    Give me 5 more... And I'll attach the package here!

  7. #27
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Couldn't include the whatwedo.swf... Package was too large.
    Attached Files Attached Files

  8. #28
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    VERY much appreciated!
    Finished work for the day, but will hopefully get the whole thing up online tomorrow.
    If you've set up one or two of the buttons I should manage the other 3 or 4.

    As I said earlier... Thanks VERY much... you've saved my life.
    I wish I could buy you a beer!

  9. #29
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    Me again (oh no I hear you cry!)
    Nothing bad though...

    Had a wee problem which I've managed to fix, but was wondering if you could tell me the reason for it... and also to explain a couple of bits of your code. Its all very well for me to have it working etc, but I'm the kind of person that likes to know HOW it works!

    Any chance you could give me a wee bit of an explanation into how the whole thing works, and then explain the couple of bits of code I've selected below?
    There is no hurry for this time, cause I have it working! Its just for my own piece of mind, so next time I can do it myself, and know how it all workss.


    The problem I had was that if I went to What We Do, and then went to Contact, then back to What We Do, it would start in frame 2 I think, hence the animation would have started, and you'd miss the first bit of text.
    I sorted this by putting a blank frame at the start of What We Do. It seems to work, so I was just wondering why it goes to frame 2 the second time round?



    Code....

    Off a button: -

    on (press) {
    _level0.movie_to_load = "whatwedo.swf";
    }

    on (release) {
    if(_level0.current_selection == "what"){
    stop();
    } else {
    _level1.gotoAndPlay(2);
    _level0.current_selection = "what";
    }
    }


    I sort of understand whats going on here. Your checking that its not the same movie as is already on screen. If it is, you not loading it.
    Why "on (press) { _level0.movie_to_load" rather than the usual "on (release) {loadMovieNum"?



    From SLIDE.SWF:-

    _level0.HolderMC.loadMovie(_level0.movie_to_load);
    this.preloader.gotoAndStop(2);

    What does this do?


    I also notice that you've got a pre-loader in there. I read about it in one of your other posts, so sort of understand that. I was wondering if its possible to ass a percentage bar to it, and if so, how?!



    Just like to say thanks again for your patience and the work you've put in to help me out.

  10. #30
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    First question...

    I had set it up differently at first, then changed it like it is, because if I started the loaded movie playing only after the wipe effect was over, then the wipe wasn't wiping anything, because the movie would then appear only when the wipe was at the top. The solution to that is then to have your loaded movies static for a few frames (in fact it should hold as many static frames as the length of the wipe up itself), so that the wipe as something to wipe , and that the animation only happens when the wipe is finished. That worked with contact, because it's all static, but didn't really with whatwedo, because your animation started right on the first (or close to...) frame of the movie. Since I didn't have the .fla to whatwedo, I couldn't add to few static frames at the beginning to give the wipe time to do it's wiping effect. Get it?

    Second...

    I've used the "press" of the button only to set the variable holding the movie to be loaded according to which button was pressed. The "release" of the button starts the wipe down and it's in fact the wipe movie that loads the proper movie when "the door is closed" according to what the variable movie_to_load holds when it was set on the press of each button. It also starts the preloader that checks to see if the movie is already in the user's cache, and if not, actually loads it in. When the movie is loaded, the preloader starts the movie playing and signals the wipe that it should move up because the movie is loaded and playing. If the movie is already in the user's cache then all of that would happen almost instantly, the wipe closing and then opening up right away.
    You're right the "release" also checks to see if the selection made is already loaded up, and if so stops the actions envolved right there and then. What's the point of re-loading a movie that's already there!
    Finaly all of the actions could of been set on the "press" or "release" or as I have done here, seperated on both. This way if the user presses the button, but keeping the mouse button down, then changes his mind and rools off the button, the "release" actions won't be executed! If everything was on "press" then you can't change your mind!

    Third...

    Think I've already explained what the the slide.swf does, and yes you could easily add a progress bar. I could set one in, and attach the new .fla here if you'd like!
    Last edited by oldnewbie; 02-11-2003 at 11:15 AM.

  11. #31
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    Genius!!!!!

    I take it you've done alot of Flash in your time?!

    Thanks for the explanation. It all makes sense now.
    Which is the bit that checks the cache, cause I have another site that I really should have used that on (http:\\www.belmont-street.com).
    I've moved the whatwedo along to frame 2 before the action starts, so thats fixed it. I'll know that if I have any other animated files to make them start at 2 too.

    I've tried every one of the tips for the graphics "jumping" off the Macromedia website, but it still does it. Not really worried about that just now though. Just concentrating on getting the damn thing online!
    Waiting on the guy to come in to tell me what he wants for Case Studies and Products.

    If you've got a few spare mins it'd be a great help to me if you added the progress bar. I presume it would just be the "swipe.fla" that'd change, cause I've been working on the kss.fla a bit today?
    How can I check the pre-loader without actually putting the sit online?
    Normally my pre-loaders are at the start of the movie, and I can check them in Flash Player by "show streaming" or something, but it doesn't seem to work with these?

    Thanks again...

  12. #32
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    When the loadMovie action is invoked, an automatic check is done to see if there happens to be a cached version of this movie on the user's machine. If there is one, that one is used and thus the movie is not really loaded, since another version of it is already cached and available.

    I'll see what I can do for the loadbar and yes it would only be in the slide.swf.

    The way to check the preloader, is to upload the content movies to your server and then use that full URL in your setting of "movie_to_load", in your kss.fla when testing it locally. Also make sure your cache is cleared, each time you want to test this, otherwise the cached files will be used and you won't see the preloader at all.

    I've only been "playing" around with Flash for some 3 years... For the fun of it, and helping others when I can. And I'm not even in web design. Semi-retired film editor!

    http://us.imdb.com/Name?Gill,+Fran%E7ois
    Last edited by oldnewbie; 02-11-2003 at 12:13 PM.

  13. #33
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    Wow... I am impressed. Thats some list of films you've got under your belt! I did a degree in computing at uni, but they never even looked at Flash
    I just started looking at a few books about 6 months ago. Hopefully in a few years I'll be up to 4000 odd posts too

    Hmmm... having to upload the files causes a bit of problem, cause I still haven't bought any web space yet! Suppose that gives me incentive to get my finger out! I probably have some free ISP space kicking about somewhere?

  14. #34
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    Bought web space, and almost finished the case studies page.
    Just about ready to go online.
    Don't suppose you've had a chance to have a look at the loadbar yet?

    Many thanks...

  15. #35
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Added the loadbar to slide.fla.

    You can change the color or whatever... And it should work.
    Attached Files Attached Files

  16. #36
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    Thanks again...
    Hopefully this should be the last time I need to bother you for a while?!

  17. #37
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    Actually, there is one last thing...

    I currently have this in the first frame of the kss page :-

    loadMovieNum("slide.swf", 1);
    loadMovieNum("top_logo.swf", 3);
    stop();
    _level0.current_selection = "home";

    What do I need to add to have my home page load up on startup?
    Its called home.swf
    I'm sure it must just be a line or 2?

    Cheers

  18. #38
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Did you sort this problem out?

  19. #39
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    Afraid not yet...
    Have tried a couple of things, but they always result in it not working properly!
    I'm sure its just a simple line?
    Do you know what I need to do?

    Cheers

  20. #40
    Member
    Join Date
    Sep 2002
    Location
    Bonnie Scotland
    Posts
    76
    Fallen at the last hurdle!
    This is the last thing I need to do.
    Everything else is practically ready to go up.
    Pleeeeeeeaaaaaaase 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