Rollover and gotoAndPlay not working after stop action

  • Thread starter Thread starter fredlexus
  • Start date Start date
AI Thread Summary
The discussion centers on a Flash website featuring rollover buttons that trigger movie playback. The first three buttons function correctly, transitioning to specific frames as intended. However, the remaining four buttons fail to perform the same actions despite having similar code structures. The user has attempted to troubleshoot by modifying the 'gotoAndPlay' commands to include 'this.' before the frame names, but this has not resolved the issue. There are no syntax errors reported, and each movie has a stop action on its first frame. The main challenge is ensuring that the additional buttons replicate the successful behavior of the first three, allowing users to navigate to the correct frames upon selection. Further investigation into the button instance names and frame references may be necessary to identify the underlying problem.
fredlexus
Messages
3
Reaction score
0
Subject: Flash (cs4, as3)
Background:
I have a website with 7 rollover buttons that play a movie. The first 3 buttons display from frames 17-29 (timeline animation plays on frames 1-16). Frame 29 has a stop action as well as blank keyframes. This gives the user the opportunity to select one of the 3 buttons. The same code is repeated on frame 30 for the additional 4 buttons (the instance and frame names are different.
- The objective is to have a movie play and the user sent to a different frame each time a button is selected.

Code:
import caurina.transitions.*;
import caurina.transitions.properties.*;
DisplayShortcuts.init();
conbut.addEventListener(MouseEvent.ROLL_OVER, conbut_ROLLOVER);
function conbut_ROLLOVER(e:MouseEvent):void
{
Tweener.addTween(contact_1, {_frame:10, time:0.2, transition:"linear"});
var over:Over = new Over();
over.play();
}
conbut.addEventListener(MouseEvent.ROLL_OUT, conbut_ROLLOUT);
function conbut_ROLLOUT(e:MouseEvent):void
{
Tweener.addTween(contact_1, {_frame:0, time:0.5, transition:"linear"});
} 

conbut.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_29);
function fl_ClickToGoToAndPlayFromFrame_29(event:MouseEvent ):void
{
gotoAndPlay("contact..");
}

- The code for the remaining 6 buttons is similar except for the instance and frame names. I've attached 2 action script files (pdf format).
The code above works as expected for the first 3 buttons. The issue is with the other 4 buttons. Although the first 3 buttons play their movies and the user is sent to the correct frames which play when the button is selected, this behavior is expected to repeat with the other 4 buttons, but is not. How can this be fixed? I am not getting any errors.
 

Attachments

Last edited by a moderator:
Technology news on Phys.org
Adding additional info to post:

- There is a stop action on the first frame of each movie
- In the code for last 4 buttons I replaced 'gotoAndPlay("home..")' with 'this. gotoAndPlay("home..")'; replaced 'gotoAndPlay("news..")' with 'this. gotoAndPlay("news..")'; replaced 'gotoAndPlay("gallery..")' with ' this.gotoAndPlay("gallery..")'; replaced 'gotoAndPlay("gallery..")' with ' this.gotoAndPlay("gallery..")'; and replaced 'gotoAndPlay("contact..")' with ''this.gotoAndPlay("contact..")'.
Checking the syntax did not produce any errors but, when the buttons are selected the movies do not play and the user is not sent to any frame.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top