Copy link to clipboard
Copied
i m using adobe flash cs3 profficional software version...in my flash document i m using some buttons but i didn't get action script to that buttons...what is the reason?....can any one solve this problem....plz give me the reply....
1 Correct answer
When you posted, it was likely bedtime for most of the folks that help here, so you need to be patient. And the folks that help here do it voluntarily, so try not to complain if your posting doesn't get answered in a timely manner. Very often a posting isn't answered because it doesn't provide any information that might help solve it--people don't realize that they need to help others to help them. And yours would fall into that category.
What code are you using that is not working and where a
...Copy link to clipboard
Copied
hi guy whats up!!!!!!!!!!.....till now i didn't get any answer!!!!!!!!!!!!.............
Copy link to clipboard
Copied
When you posted, it was likely bedtime for most of the folks that help here, so you need to be patient. And the folks that help here do it voluntarily, so try not to complain if your posting doesn't get answered in a timely manner. Very often a posting isn't answered because it doesn't provide any information that might help solve it--people don't realize that they need to help others to help them. And yours would fall into that category.
What code are you using that is not working and where are you placing it?
Copy link to clipboard
Copied
just simple button program...whenever click that button one image will be displayed...that is my logic....each button have one image...but the script is not working....how to add actions to buttons?...
Copy link to clipboard
Copied
Show your script code.
Copy link to clipboard
Copied
stop();
aboutus_btn.onRelease=function(){
gotoAndPlay(1);
gotoAndStop(3);
gotoAndStop(2);
gotoAndStop(6);
gotoAndStop(4);
gotoAndStop(5);
};
contactus_btn.onRelease=function(){
gotoAndPlay(2);
gotoAndStop(1);
gotoAndStop(3);
gotoAndStop(6);
gotoAndStop(4);
gotoAndStop(5);
};
employment_btn.onRelease=function(){
gotoAndPlay(3);
gotoAndStop(1);
gotoAndStop(2);
gotoAndStop(6);
gotoAndStop(4);
gotoAndStop(5);
};
movies_btn.onRelease=function(){
gotoAndPlay(4);
gotoAndStop(1);
gotoAndStop(2);
gotoAndStop(6);
gotoAndStop(3);
gotoAndStop(5);
};
technology_btn.onRelease=function(){
gotoAndPlay(5);
gotoAndStop(1);
gotoAndStop(2);
gotoAndStop(6);
gotoAndStop(4);
gotoAndStop(3);
//gotoAndStop(0);
};
but it is not working properly..........can u plz give me short length code.....
logic is:each button display one image....
Copy link to clipboard
Copied
aboutus_btn.onRelease=function(){
gotoAndPlay(1);
gotoAndStop(3);
gotoAndStop(2);
gotoAndStop(6);
gotoAndStop(4);
gotoAndStop(5);
};
Each of those gotoAndStop commands are telling the timeline that the code is in to go to different frames, so ultimately, you are likely ending up on the last in each list. Code is executed almost instantaneously, before frame movements occur, so you won't see things moving from frame to frame if that is what you expect. What do you really want?
Copy link to clipboard
Copied
i want :-whenever click one button it will be displayed one image....i have 7 buttons & 7 images...(each button have different image)
Copy link to clipboard
Copied
I am going to have to make assumptions about your design since you haven't explained how you have it assembled.
From what I've already mentioned, hopefully you understand that you can only use one gotoAndPlay for a button function for it to be sensible.
aboutus_btn.onRelease=function(){
gotoAndPlay(1);
}
And, assuming your images are one per frame and they are in frames 1 thru 7, and each button is supposed to go to a specific frame, then it will be better to use....
aboutus_btn.onRelease=function(){
gotoAndStop(1);
}
Either version of the code I showed are valid for making a button work, as long as the code is on the timeline in the presence of the buttons. So if your buttons are not working, then you may not have given them the instance names your code uses. Instance names are assigned by you in the properties panel, they are not the names you give them in the library.

