?
Solved

Button rollover onEnterFrame issue

Posted on 2008-06-20
7
Medium Priority
?
887 Views
Last Modified: 2013-11-11
Hello Experts,

I have a menu, which once a button is clicked it stays highlighted and loads the page as buttons do. I would now like it to, onEnterFrame, load the first buttons page rather than stay blank, but keeping the current function of the buttons.

The site can be seen here, and click on the books menu at the top. http://www.rpbooks.co.uk/denismcbride

The code on my buttons is:
And the var selectedButton code is then added up a level to call the function.

Thanks,
Chris
stop();
this.onEnterFrame = function() {
	if ((_parent.selectedButton != this) && (rewind == true)) {
		prevFrame();
	}}
};
this.onRollOver = function() {
	if (_parent.selectedButton != this) {
		rewind = false;
		play();
	}
};
this.onRollOut = function() {
	if (_parent.selectedButton != this) {
		rewind = true;
	}
};

Open in new window

0
Comment
Question by:Nutbeen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 5

Expert Comment

by:cwickens
ID: 21833500
The onenterframe function has one to many closing brackets it appears:

this.onEnterFrame = function() {
        if ((_parent.selectedButton != this) && (rewind == true)) {
                prevFrame();
        }} //<-- extra  here
};

Also, you could add an else statement so the _parent displays what you want and the 'button' highlights as you want as well.
0
 

Author Comment

by:Nutbeen
ID: 21845682
I'm afraid I'm going to need more help than that...Action script beginner
0
 
LVL 5

Expert Comment

by:cwickens
ID: 21864701
If you look in your code in the original post, line 5 has 2 closing braces "}}" remove one of them and then see if that works.

You dont need to delete the question, I am pretty certain that is your issue.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:cwickens
ID: 21864967
Ok, after re-reading your question, it sounds like you want to use the URL of current browser window and pass it into flash and use that to keep the button highlighted for the page you are on.  Is that correct?

By the way, my last post still applies...there is one to many braces in your onRollOver() function.
0
 

Author Comment

by:Nutbeen
ID: 21867072
Yeah that sounds right. It's just so when you go to the site, the home button will automatically highlight, without having to click it.

Sorry I'm not much help..lol

I have change the braces error you mentioned.

Thanks
0
 
LVL 5

Accepted Solution

by:
cwickens earned 2000 total points
ID: 21867225
no problem.  The issue (not a horrible problem) is that in order to access the current URL of the browser window, you need some serverside code, PHP, ASP, CF, etc.

You could default the "home" button to being highlighted.  Then you could pass a variable with your getURL(); that would make whatever page you are going to highlighted.
0
 

Author Comment

by:Nutbeen
ID: 21875279
Thanks, thats done it!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question