A Flash Developer Resource Site

Results 1 to 18 of 18

Thread: [F8] Jump

  1. #1
    Member
    Join Date
    Apr 2005
    Location
    Dubai, UAE
    Posts
    57

    [F8] Jump

    Hi All,

    Buttons on Stage are setting a variable to their names like (aboutus, products, portfolio, etc.). But Actionscript on frame isn't make a jump to related location.

    Actionscript on one of the buttons:
    Code:
    on(release){
    	jtl = "portfolio";
    	trace (jtl);
    	_root.play();
    }

    Actionscript on frame:
    Code:
    onEnterFrame = function () {
    	if (jtl="aboutus") {
    		gotoAndPlay("Abt");
    	} else if (jtl="products") {
    		gotoAndPlay("Pdc");
    	} else if (jtl="portfolio") {
    		gotoAndPlay("Pfo");
    	} else if (jtl="clients") {
    		gotoAndPlay("Clt");
    	} else if (jtl="contactus") {
    		gotoAndPlay("Cnt");
    	}
    };
    Please have a look at the attachment and suggest.
    Last edited by Mr.FlashKit; 01-22-2008 at 02:00 AM.
    Mr.FlashKit

  2. #2
    Member
    Join Date
    Apr 2005
    Location
    Dubai, UAE
    Posts
    57
    Hey ... is there no one who can help ...
    Mr.FlashKit

  3. #3
    Member
    Join Date
    Apr 2005
    Location
    Dubai, UAE
    Posts
    57
    Hey! ... is there no one who can help ...
    Mr.FlashKit

  4. #4
    Senior Member
    Join Date
    Jan 2006
    Posts
    263
    Nevermind sorry I misunderstood, And I am unable to download your .fla at the moment.
    Last edited by jamesloacher; 01-08-2008 at 07:23 AM.

  5. #5
    Member
    Join Date
    Apr 2005
    Location
    Dubai, UAE
    Posts
    57
    Try now ... I've attached it again ...

    Please its Urgent ...

    Thanks ...
    Last edited by Mr.FlashKit; 01-22-2008 at 02:00 AM.
    Mr.FlashKit

  6. #6
    Member
    Join Date
    Apr 2005
    Location
    Dubai, UAE
    Posts
    57
    Hey! Guys Co'mon ... It's Urgent ... Please ...
    Mr.FlashKit

  7. #7
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    _parent.jtl = "aboutus";

    gparis

  8. #8
    Member
    Join Date
    Nov 2007
    Posts
    68
    hi, make your buttons movie clips and your script will work. hth

  9. #9
    Member
    Join Date
    Apr 2005
    Location
    Dubai, UAE
    Posts
    57
    Thanks a lot gparis and namedflea ...
    I've implemented both of your suggestions but unfortunately it's still not Jumping ...

    Is the code on the Frame OK ... Should it supposed to work ... ?

    Please suggest ...

    Thanks
    Mr.FlashKit

  10. #10
    Member
    Join Date
    Sep 2007
    Posts
    57
    It's not one but two things that are throwing you off.

    First is a simple one in your if/else if statements. You're using a single equals (=) which sets a variable when you should be using double equals (==) to compare values.
    PHP Code:
    onEnterFrame = function () {
        if (
    _root.jtl == "aboutus") {
            
    gotoAndPlay("Abt");
        } else if (
    _root.jtl == "products") {
            
    gotoAndPlay("Pdc");
        } else if (
    _root.jtl == "portfolio") {
            
    gotoAndPlay("Pfo");
        } else if (
    _root.jtl == "clients") {
            
    gotoAndPlay("Clt");
        } else if (
    _root.jtl == "contactus") {
            
    gotoAndPlay("Cnt");
        }
    }; 
    Secondly your variable of jtl is being stored in multiple locations. Each button object was setting it's own value of jtl in it's own properties instead of everyone looking at a common variable. For simplicity I just set it to _root.jtl but you can change that to wherever you may want. Below is the code for each of the buttons.

    PHP Code:
    on (rollOver){
        
    gotoAndPlay("+ve");
    }
    on(rollOut){
        
    gotoAndPlay("-ve");
    }
    on(release){
        
    _root.jtl "contactus";
        
    trace (_root.jtl);
        
    _root.play();


  11. #11
    Member
    Join Date
    Nov 2007
    Posts
    68
    here is the code for the frame...
    this.onEnterFrame = function () {
    if (jtl=="aboutus") {
    gotoAndPlay("Abt");
    } else if (jtl=="products") {
    //trace(jtl);
    gotoAndPlay("Pdc");
    } else if (jtl=="portfolio") {
    gotoAndPlay("Pfo");
    } else if (jtl="clients") {
    gotoAndPlay("Clt");
    } else if (jtl=="contactus") {
    gotoAndPlay("Cnt");
    }
    };


    here's the code for one of the mc's

    on(release){
    _parent.jtl = "products";
    }

    make your "buttons" movie clips for this to work. hth

  12. #12
    Member
    Join Date
    Apr 2005
    Location
    Dubai, UAE
    Posts
    57
    GrimStrike and namedflea ...
    Thank you so much guys ... it worked ...

    Thank U
    Mr.FlashKit

  13. #13
    Member
    Join Date
    Apr 2005
    Location
    Dubai, UAE
    Posts
    57

    Jumping is OK but Now its Not Playing ...

    Jumping is OK but when it reaches its destination the Timeline stops itself even thought I've put the code gotoAndPlay() in the jumping frame and there is not stop() in the destination frame.

    Please guys I need your help once again ... (FLA) is attached in this post ...

    Many Thanks
    Attached Files Attached Files
    Last edited by Mr.FlashKit; 01-22-2008 at 02:01 AM.
    Mr.FlashKit

  14. #14
    Member
    Join Date
    Nov 2007
    Posts
    68
    looks fine to me, you need to have navigation in all the destination frames. otherwise you'll just be stuck like you are now. you do have stops in your destination frames (17, 23,29,36 and 41) you need to... otherwise your movie would loop right through them. hth

  15. #15
    Member
    Join Date
    Apr 2005
    Location
    Dubai, UAE
    Posts
    57
    You're right but even if you remove stop() from all the destinations the timeline will still stuck itself ...

    Try it ... and then please suggust

    Thanks for your reply namedflea
    Mr.FlashKit

  16. #16
    Member
    Join Date
    Apr 2005
    Location
    Dubai, UAE
    Posts
    57
    Hey! ... No one ...
    Mr.FlashKit

  17. #17
    Member
    Join Date
    Apr 2005
    Location
    Dubai, UAE
    Posts
    57
    Please see the Attachment in Post # 13 and then suggest ... also read that post ...

    Plzzzzz ...
    Last edited by Mr.FlashKit; 01-23-2008 at 02:08 AM.
    Mr.FlashKit

  18. #18
    Member
    Join Date
    Apr 2005
    Location
    Dubai, UAE
    Posts
    57
    Hey! ... No one ...

    Please see the Attachment in Post # 13 and then suggest ... also read that post ...

    Plzzzzz ...
    Mr.FlashKit

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