We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,548 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Flash -action script 3 - first frame function vs last frame function

Hi, I'm having a problem with the stop() and play() functions
The first frame function works fine during the first run of the program
but as i hit space in the last frame ( go back to frame 0 ) the first frame function
saying whether to stop or play isnt working and pressing the space button always does
gotoandstop(0) .

any ideas?tried removing evenListeners but still nothing
this is the first frame function

import flash.ui.Keyboard;
import flash.events.KeyboardEvent;

stage.addEventListener(KeyboardEvent.KEY_DOWN, hearKeyyy);

function hearKeyyy(yourEvent:KeyboardEvent):void{
    if (yourEvent.keyCode==32){
        stop();
    };
    if (yourEvent.keyCode==13){
        play();
    };
};

this is the last frame function

stop();
stage.addEventListener(KeyboardEvent.KEY_DOWN, hearKey);
function hearKey(yourEvent:KeyboardEvent):void{
    if (yourEvent.keyCode==32){
        gotoAndPlay(0);
    };
};

thanks

1
Contributor
0
Replies
1
View
Despairy
Junior Poster
123 posts since Mar 2011
Reputation Points: 10
Solved Threads: 5
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0522 seconds using 2.66MB