dcsimg
A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 22

Thread: advanced actionscript needed

  1. #1
    The Insane bfly03's Avatar
    Join Date
    May 2001
    Posts
    692

    advanced actionscript needed

    inside the fla i have a layer called "nav".
    inside there are my buttons, on the "under layer"
    and a mc, on the "blue" layer.

    right now the mc plays constantly, i want it to start at a certain
    frame (5) when you rollover from button to button. But i only want it
    to play when the "nav" is moving.

    and to top it off after the "nav" stops moving or you rollout i want
    the animation to gotoandstop on the closest frame in the "blue" layer,
    either frame 5 or 10.

    the fla

    Thanx,

  2. #2
    I'm a POTato Head! The Whyte MaN's Avatar
    Join Date
    Aug 2002
    Location
    In my head
    Posts
    113
    Bfly,

    Let me get this straight,
    You want the movie clip to start on frame 5 when you begin scrolling through. Then when you stop scrolling you want the movie clip to end on frame 10?

  3. #3
    The Insane bfly03's Avatar
    Join Date
    May 2001
    Posts
    692

    can anyone help?...

    where are the actionscript experts?

  4. #4
    Over-rated Wannabe
    Join Date
    Feb 2003
    Posts
    20
    You asked if I could help but I'm sorry I don't think I can on this one. But from the looks of your fla I think maybe you could help me with this thread

    Take a look if you get a chance.
    Thanks

  5. #5
    Registered User
    Join Date
    Jul 2002
    Location
    Dallas, TX USA
    Posts
    171
    The way your fla is setup is a bit counterproductive.

    Try this. Add a new layer in your water movie. Add frame labels for 'start' and 'stop'. When your action for mouseover and moustout is executed, reference a function in the global timeline that you control the movieclip water with gotoandstop or gotoandplay actions targeting your frame labels. Like add some new frames for the water to 'start' then have it loop in the middle section for a long mouseover, then have a water animation for 'stop'...in this respect you'd use gotoandplay and have actions in the target movie clip to reset to 'no water' action with a frame label called 'off' in which you would always use a gotoandstop action to go the 'off' position without animation.

    Say your 'off' label was in frame 1 of the water clip.

    Then your function would be like this in your main timeline on frame 1 of the global movie:
    Code:
    function WaterToggle(toggle){
      if (toggle==1){
        mv_water.gotoAndPlay("start");
      }
      if (toggle==2){
        mv_water.gotoAndPlay("stop");
      }
      if (toggle!=1 || toggle!=2){
        mv_water.gotoAndStop("off");
      }
    }
    Then in your mouseover mouseout actions reference the function to handle the water with this:
    Code:
    _root.WaterToggle(1); //turns on the water
    _root.WaterToggle(2); //turns off the water
    _root.WaterToggle(); //immediately stops the water
    Last edited by DFWStudios; 04-21-2003 at 12:33 AM.

  6. #6
    The Insane bfly03's Avatar
    Join Date
    May 2001
    Posts
    692
    DFWStudios,

    check it out now fla. I am not sure what I did wrong:

    I added the code to the first frame(main timeline)
    I added the code to every button
    I added another layer with start and stop labels

    Now the scrolling effect dosen't work and I am getting
    some kind of error message. What did I do wrong? How can
    I fix it?

    Thanks,
    bfly03

  7. #7
    Senior Member
    Join Date
    May 2001
    Posts
    351
    the weird error you get is because you have actions in a symbol without an event

    you need to put code inside an event, or action
    like onRelease, toggle water

  8. #8
    The Insane bfly03's Avatar
    Join Date
    May 2001
    Posts
    692
    I am confused,

    would i put the code on each individual button?
    what would the code look like?

  9. #9
    Senior Member
    Join Date
    May 2001
    Posts
    351
    you also were using a reserved keyword as a function argument
    you had function WaterToggle(switch)

    switch is a flash keyword

    i had to take out all of your water toggle code to get it to run without errors
    so it scrolls, but i dont see any water

    what is supposed to make the water Toggle?

  10. #10
    The Insane bfly03's Avatar
    Join Date
    May 2001
    Posts
    692
    this is what i wanted to happen:

    when you roll over the buttons below i wanted the animation to begin playing and when you rollout it goes to the stop frame.

    look under the blue layer to find the "water" mc

  11. #11
    Senior Member
    Join Date
    May 2001
    Posts
    351
    ok bfly, heres what you do

    go to the file button on top, click once
    select new, click again

    now take your water mc from old movie, and drag into new
    thats about the only thing worth saving from your current fla

    if you want to do advanced acrionscripting, you should start off right.

    i would have an empty movieclip in my library
    use attach movie to bring on screen and give it a name
    you can also assign on rollover events
    ex:
    clipHolder.onRollOver = overClipHolder(); // overclipholder is a function

    now i would write a loop to load your little buttons(make them mc's)
    into the empty clip
    ex:
    tempThing = clipHolder.attachMovie(thing) // look up the correct syntax

    and you can assign events to that
    ex:
    tempThing.onRollOver = overThing();
    tempThing.onRollOut = outThing();

    so , the empty clip gets filled with your things and has a function to show the water

    and your things are loaded and have functions for your over and out stuff

    thats closer to advanced action scripting

    good luck

  12. #12
    The Insane bfly03's Avatar
    Join Date
    May 2001
    Posts
    692
    thanks for your time, but i am still unable to get that to work. is there any other way to accomplish my goal?

    the way i had it set up before, why was that bad?

    thanks

  13. #13
    Senior Member
    Join Date
    May 2001
    Posts
    351
    ok, heres my modified fla
    i dont know how you want the thing to work, with scrolling and all
    and the water bobbing

    check out my fla and let me know if you have any questions
    Attached Files Attached Files

  14. #14
    The Insane bfly03's Avatar
    Join Date
    May 2001
    Posts
    692
    see, i wnted to keep the same scrolling effect, and when the buttons start to scroll i wanted the water animation to play. when rollout of the buttons, the animation should play until a certain frame then it stops.

  15. #15
    The Insane bfly03's Avatar
    Join Date
    May 2001
    Posts
    692
    another thing,
    when i try to put the scrolling pic viewer into a mc, the code gets messed up somehow and the scroll part is screwed up bad. any idea why, or how to fix it?

  16. #16
    Senior Member
    Join Date
    May 2001
    Posts
    351
    the only other help i can offer is to build it for you

    use your scroll code in the new fla
    you can add it to the overThing function

    for the sea to move and stop, i would create a variable in the water mc

    var doIStop = false;

    when you rollover, set it to true;
    water.doIStop = true;

    on the frame of the water, check you var
    if(doIStop == true) stop();

  17. #17
    Registered User
    Join Date
    Jul 2002
    Location
    Dallas, TX USA
    Posts
    171
    Wow, I took a couple days off from the thread and now I'm way behind...what exactly is the current fla everyone's been working on?

    Basically, I'd convert the scrolling of the movie clip to a global main timeline function you define in Frame 1 of the main movie. Then access that via _root.FUNCTION_NAME(arguments); on your mouse events to scroll or not scroll etc....and also depending on the same event, include function calls for targeting the blue wave mc on the main timeline from within the nested clips' buttons.

  18. #18
    The Insane bfly03's Avatar
    Join Date
    May 2001
    Posts
    692
    DFW,

    I am still tyring to get the fla that I posted working. nadskram was helping out and made a fla but I couldn't understand his logic. Maybe you could help out. The latest fla has been posted (the first one), but the server that it is on is down for the moment. I will go reconnect the server in a minute. Thanks

  19. #19
    Senior Member
    Join Date
    May 2001
    Posts
    351
    dont understand my logic?
    dont understand my logic?
    how can you say that?
    after all we been through.actually it wasnt much, but still.
    what dont you understand about it

  20. #20
    The Insane bfly03's Avatar
    Join Date
    May 2001
    Posts
    692
    it not you... it me.
    ha ha ha.

    ok,
    it wasn't really the logic, i just couldn't get the thing to work. Then i tried taking my 'scrolling pics' and throwing it into the fla you posted and for some reason the code got all screwed up. i was just having problems. i also couldnt get the 'water' to be still 'frame 5' and when rollover play until rollout goto 'frame 10'. maybe i am over my head but i am stubborn and not going to stop until its right. thanks for the help.

    oh yeah, the server that the fla is on is down for at least today, ill have to find a way to get the file to you...

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