A Flash Developer Resource Site

Page 3 of 3 FirstFirst 123
Results 41 to 57 of 57

Thread: Preloader, flash intro to web page question

  1. #41
    Trying hard to get it
    Join Date
    Aug 2005
    Location
    Fort Lauderdale, FL
    Posts
    76

    I had a breakthrough!!

    I figured it out! I had forgotten to give an instance name to the movie clip and that's why it wasn't playing it. It didn't know its name!!

    Awesome. (I was brushing up in my action script for the past day) and it paid off!

    Very cool.

    Now I want to figure out the action script to make the flying fluff repeat itself every couple of seconds. I don't know if to put the action script at the end of the movie clip or at the beginning with the stop() action.
    I found out about continuous actions with set intervals and I wrote on the first action of the flyingfluff movie clip
    stop(); (so it would hold the movie until it was time to play it)
    setInterval(flyingfluff,2000); (so it would play the "flyingfluff" every 2 secs but I am missing something)

    I know it should be told that at the next play (not the first) it should do the intervals but I don't know how to tell it that.
    Can you fill me in?
    Michelle

  2. #42
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    ok..so what are we trying to fix now?

    I see the flyingfluff clip is on stage... (and an instance name given..good)

    Now..when yuo OPEN the flying fluff clip.. I knwo you can count..LOL.. so what frame # is the stop action on? (its on frame 2)...and you have ablank frame in frame 1 (where the stop action should be)..

    so in frame 2 you have a STOP; action.. in the last frame there is code of:

    _root.logoClip.play(); (which by the way wasnt given an instance name..so it cant be "talked" to)

    but I notice ther is NO stop action in the last frame..which means the playheads resets..and plays over again at frame 1..but there is no action to stop it on frame 1..so it moves on..frame 2 has a stop; action..so it stops there..


    Now...to get into some more advanced actionscript.. (by the way..I am a newbie..and others are probably WAY more suited to help on this.and ther are probably several other ways to do this)

    but lets find out what you want it to do.

    Do you want the flyingfluff to continually play? Liek every few seconds have another one "fly off"? and do you only want it to happens a few times?

    dependig on what you want...is how will approach it..

    you can use a soemthign liek setInterval if you want it to fire every few seconds..

    or we can build a little counter that will stop it after 3 (or whatever) times..

    up to you..

  3. #43
    Trying hard to get it
    Join Date
    Aug 2005
    Location
    Fort Lauderdale, FL
    Posts
    76
    I was reading up on action script and I found the setInterval thing. I tried to apply it but it didn't seem to work. Maybe because the action script is on the 2nd Frame?

    Anyway. The action script I wrote was (and this time I did name the instance LOL!) I put this in the same frame as the stop frame. (on the wrong 2nd frame LOL)

    Stop();
    setInterval(flyingfluff, 5000);
    function flyingfluff(){

    }

    This is how the book suggested to do it. But it didn't work... surprise!!

    I would like it to continue to play over and over. every 5 seconds (thats the 5000 there).

    I also applied a movie clip that contains some words that as the first fluff flies by it will uncover this text and it came out great. I added the extra action script and it worked like a charm. This one I am thinking of just playing it once.

    I am now also going to figure out the button to enter into the site.

    To tell you the truth I am still divided into doing the site all flash or doing it html and flash. I know I could do more with it being all flash but It would also be super labor intensive under such tight deadline. Although I am getting this pretty fast...What do you think?...doable?

    One thing I really need to figure out is the preloader thing and the sound. But lets finish the repeat problem and the button and I am ready for the preloader then.

    Let me know what you think as to how to attack the action script. You may not be great at it but I am even worse. LOL!
    Attached Files Attached Files

  4. #44
    Trying hard to get it
    Join Date
    Aug 2005
    Location
    Fort Lauderdale, FL
    Posts
    76
    I posted the question about the intervals on the action script forum and I got a couple of answers that I still don't understand... one said this:

    you don't need a setInterval for this, I wouldn't bother with it.
    put this on the first frame of the movieClip in question...

    Code:
    if(!init)
    {
    stop();
    }

    and when you want to play it, write something like...

    Code:
    mc.init = true;
    mc.play();



    and the other one I will post in a sec...

  5. #45
    Trying hard to get it
    Join Date
    Aug 2005
    Location
    Fort Lauderdale, FL
    Posts
    76
    This is the other reply:

    this is a simple one that i used for a life bar to slowly heal itself in an RPG that I am doing:
    Code:
    function heal(){
    _root.lifebar.nextFrame;
    }
    setInterval(heal,2000);
    This code calls the heal function every 2000 milliseconds, which is 2 seconds. This is an example. Put the setInterval actions that you have in the current frames.


    What do you think??

  6. #46
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    the second would be correct..

    the first would NOT work for your automated "play" that you want every 2 seconds (or whatever...)

    and your code would look like this:
    Code:
    function playAgain(){
    _root.flyingfluff.play();
    }
    setInterval(playAgain,2000);
    but you need to do a few things..(some tricky frame jumping and extra "stop;" frames.

    1.) INSIDE yoru flyingfluff clip:
    a) you need ato add ANOTHER blank frame at the beginning with a stop action. (actions layer)
    b.) in frame 2 you need to have this code:
    Code:
    stop();
    function playAgain(){
    _root.flyingfluff.play();
    }
    setInterval(playAgain,2000);
    c.) in the LAST frame of the actions layer you need to have this code:
    Code:
    gotoAndStop(2);
    2.) your DANDELION CLIP:
    a.) you trigger the play from the timeline of the dandelion clip..so you need to adjust yoru code to start the flying fluff clip as so:
    Code:
    stop();
    _root.flyingfluff.gotoAndPlay(3);
    _root.moving_mc.play();

    attached is the final .fla (edited) and working as you want.


    Sidenote: if you want to try and get work..flash is a great tool and can be utilized for WAY more than web sites...and looks great on the resume. But only certain places truly understand it...or really need/want it. Most corporate companies want HTML with intense backends...or more so HYBRID sites....all the best of HTML & backend..with some eye candy banners and "glitz" for that pro/clean/corp look.

    Hybrid sites are great... and can be really fucntional. Look at www.2advanced.com 's portfolio....


    -whispers-

  7. #47
    Trying hard to get it
    Join Date
    Aug 2005
    Location
    Fort Lauderdale, FL
    Posts
    76
    he heeeeyyyyy!
    Looks great! I had the same movie clip by the time I pasted all the code into mine...(then I saw you had it done at the bottom, huh, and so I got good practice copying and pasting action script LOL!)

    I know what you are saying about the hybrid site. My company has one www.jkggroup.com I designed the logo and this company took it and made a hybrid site by just adding the banner and a few key changes in the flash part when a new page was called. Pretty nifty but NOTHING like the site you mentioned. That was awesome! You cannot tell where the html starts and the Flash begins. The buttons on the top nav I think are definetly flash. And of course that movie they show. There is so much to learn... oh my.

    I did add the button to my 3rd Try movie. I wanted the button to appear after the logo finished showing up (by the way. The logo on yours and mine dissapeared and re appeared when the fluff came out again. Is there a way to make it stay after that first play? i will try to figure it out while I wait for your response) back to the button. I made a movie clip of the button "glowing" basically tweening in and out which I placed in the up frame then the button only in white in the over (no MC just a graphic symbol) and then the down I changed it to yellow. I played my movie and it does show if you pass the mouse over the area (top corner under the wider box) but it does some funky stuff.
    I made the MC of the glow have a stop to it and tried to make it replay itself but I think I messed it up there.
    Here, take a look...
    Attached Files Attached Files

  8. #48
    Trying hard to get it
    Join Date
    Aug 2005
    Location
    Fort Lauderdale, FL
    Posts
    76
    I was looking at the action script for the logo not playing again and I think (definetly not sure) the action script would have to be put in the first frame of the logo movie telling it to either break loop or if played once stop at last frame?

  9. #49
    Trying hard to get it
    Join Date
    Aug 2005
    Location
    Fort Lauderdale, FL
    Posts
    76
    Nope. Changed my mind. Gotta fix the call out to the movie clip of the logo from the flyingfluff movie. Right now I have it calling the logoClip mid flight. So how can i tell it to stop at that last frame? hmmm... or move the call out of the logo to another one time playing movie clip (which would be the easiest)

  10. #50
    Trying hard to get it
    Join Date
    Aug 2005
    Location
    Fort Lauderdale, FL
    Posts
    76
    OKAY!
    Fixed my own problem... and I like it better! Moved the command to the moving layer and it calls it out at the last frame logo comes out and stays. GREAT!

    Now I still have the problem with the button enterSite. The idea is that it would show after all MC appear. The last being the logo now. Let me see if I can mess with it. (god, i feel like a plumber looking for that leak!)

  11. #51
    Trying hard to get it
    Join Date
    Aug 2005
    Location
    Fort Lauderdale, FL
    Posts
    76
    OK. couldn't do it. Tried to put the set interval into the button MC but I think I confused the button. It is there. But only shows when I pass my mouse over it.
    I included my file...

    All I am trying to do is that the button shows up at the end of the logo clip.
    That the button glows (playing the inout_mc) while it waits to be clicked
    When over it turns to just white and when clicked it turns yellow.
    That's it.
    AND THE MOVIE IS DONNNEEEE!

    If it is too much of a PIA I can just have it appear without the glow effect.
    Let me know! You're the Magic Man! LOL!!
    Michelle
    Attached Files Attached Files

  12. #52
    Trying hard to get it
    Join Date
    Aug 2005
    Location
    Fort Lauderdale, FL
    Posts
    76

    I still have no clue how to do this button...

    Maybe I am complicating myself. It sure dosn't seem that hard. But it dosn't work!! AAAaaargh!!

  13. #53
    Trying hard to get it
    Join Date
    Aug 2005
    Location
    Fort Lauderdale, FL
    Posts
    76
    Well, since I didn't get an answer on the rollover thing I opted for a simple button and that's it. Problem solved. Now I want that button to go to the HTML page. I am trying to find out that I put this into the action script of the button

    enter_btn.onRelease = function() {
    getURL("http://www.mmartorell.com/index.html");

    }


    but it is giving me an error when I play the movie:

    Scene=Scene 1, Layer=EnterSite, Frame=1: Line 1: Statement must appear within on handler
    enter_btn.onRelease = function() {


    I am also trying to put sound into the movie.

    Any help I would appreciate it. If whispers is around... drop me a line!!
    M.

  14. #54
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    If its a button use this code:

    on (press) {
    getURL("http://www.somesite.com", "_self");

    }

  15. #55
    Trying hard to get it
    Join Date
    Aug 2005
    Location
    Fort Lauderdale, FL
    Posts
    76
    Do I only put the url www.mmartorell.com or can I actually put the path to the index.html page like
    www.mmartorell.com/index.html in the path?

  16. #56
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    it is up to you..whatever page you want to bring them to...

  17. #57
    Trying hard to get it
    Join Date
    Aug 2005
    Location
    Fort Lauderdale, FL
    Posts
    76
    Well, after this post I wanted to end in a cool note. We are still working some kinks on the file but thanks to the help of whispers (my personal flash guru) my dream of having a flash intro to my site is almost a reality.

    I hope you all learned a lot from my frustrations and from whispers good advice.

    Hopefully the next flash that comes out dosn't have such a darn big learning curve LOL!!!

    Peace and send money to the victims of Katrina. We got brushed by it in fort lauderdale and it was only 95 MPH winds. They got the monster.
    BYEEEEE

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