Skip to main content
Participant
May 27, 2008
Answered

Flash header reloading is a problem

  • May 27, 2008
  • 1 reply
  • 416 views
I have a page that has a flash header (Navigation). It also has background music. I want to make sure my music keeps going while the user is navigating. I have accomplished it to an extent with html navigation. I am wanting to remove the html and let the flash work.

The way I am doing it is below, but all I am wanting to do (if somone has a better way) is I do not want my flash head to keep reloading and restarting the bg music.

I have a main page with my flash header in it and am using javascript showpage on html links using div tags and includes --javascript:showPage('ABOUT')--

What happens here is all of the pages are already loaded in the page and each link has javascript:showPage(' --div name-- ') on it and that page shows when clicked while the others hide.

I want to use this link with flash. How do I put this in the flash doc.



This topic has been closed for replies.
Correct answer judahpro
Your right, I missed a quote:

getURL("javascript:showPage('--div name--')");

And to answer your second question, yes you can put this where you need.
The code I provided was the dynamic onRelease assignment which is an alternative to putting the code directly on the button as an actionListener.

Assigning actions directly to buttons/movieClips is a bit old fashioned and hard to manage if you say have 1000 buttons...

Perfect. I actually tried this, I guess while you were typing the response.

I very much appreciate it.

getURL("javascript:showPage('---div---')");

1 reply

Participating Frequently
May 27, 2008
If I understand correctly, your document seems to be correctly setup.
If your question is, how do you call a JS function from Flash, you can do the following:

b1.onRelease = function() {
getURL("javascript:showPage('--div name--'));
}

Provided that function name exists in the HTML file the swf is sitting in, it should call it. Take warning though, that if you try to test that hyperlink in Flash, the application sometimes crashes.

I hope this helps you out.
judahproAuthor
Participant
May 27, 2008
b1.onRelease = function() {
getURL("javascript:showPage('--div name--'));
}

---Are you missing a " in the code?--- you wrote 'javascript and never closed the quotation and I am not sure where to put the last quote.

Also can't I use the geturl that you wrote on the onRelease action of the button itself instead of
b1.onRelease = function() {

If so what needs to go and what needs to stay?
Participating Frequently
May 27, 2008
Your right, I missed a quote:

getURL("javascript:showPage('--div name--')");

And to answer your second question, yes you can put this where you need.
The code I provided was the dynamic onRelease assignment which is an alternative to putting the code directly on the button as an actionListener.

Assigning actions directly to buttons/movieClips is a bit old fashioned and hard to manage if you say have 1000 buttons...