|
-
getURL("javascript:history.back()");
on (release) {
getURL("javascript:history.back()");
}
When i click on this button, it does not work in one click, have to click twice to go back in the browser and also once it has gone back if i want to return doesn't return from there,however i can write a function in javascript and call it from flash to perform this action, but am i making any mistake here, is it possible this way???
Thank you.
-
for some reason you can't access javascript methods directly from the flash. you can access functions though. so this would work:
on (release) {
getURL("javascript:fBack()");
}
where your javascript function is like this:
function fBack (){
history.back();
}
hope that helps,
jeremy
-
I know it works this way, but there are javascript functions that work directly from flash, like alert() window.open()...
I just wanted to make it sure that i am not making any mistake. Any way thanks for the reply
-
Same problem here - I have to click the button twice for the script to fire - everything is set up correctly -
On Flash button I've tried both
on (release) {
getURL("javascript:history.back()");
}
and
on (release) {
getURL("javascript:goBack()");
}
with a javascript function on the web page -
<SCRIPT language="JavaScript">
function goBack()
{
history.back();
}
</SCRIPT>
My pages are ASP pages running on PWS on NT4 workstation with IE6 client browsers.
Does anybody have any idea about the clicking twice thing ??? - driving me nuts !
Cheers,
Mont
-
Moonlight shadow
javascript:history.back(-1)
?
TE
-
Thanks for the suggestion but .back() doesn't accept parameters - I've tried .go(-1) - works ok - IF I CLICK THE BUTTON TWICE - AAAAGGGGHHHHHHH - ripping my hair out with this one !
Anybody else got any ideas ???
Cheers guys
-
Moonlight shadow
http://www.snooboo.com/errors/404.html
As you can see, I have used go(-1) and it seems to work fine - what do you mean it goes back twice?
TE
-
asheep,
Your code is in html/javascript, it will work fine, but the problem is when we want to invoke this from inside flash. We are not able to invoke this at one click of button, we have to click it twice to invoke this javascript function, also it erases the history record for the page you have clicked from. You cannot go forward to page you have come from.
-
Moonlight shadow
Do you mean go between pages in Flash? Flash shoudn't erase the history of web pages.
TE
-
You got it, u are good.
-
Moonlight shadow
ooooooooooooooooooooooooooooooooooooooo
You can't use JavaScript 'within' Flash, a Flash movie is in one single page, and as far as a browser is conserned, it is only one page.
This is the closest you can get
Code:
on (release) {
prevFrame();
}
or
Code:
on (release) {
prevScene();
}
TE
-
i am afraid, u didn't get.
I have a flash movie embedded in html page, in the flash movie i have a button say "Back", when i click this button it should invoke a javascript function like this.
on (release) {
getURL("javascript:window.history.back()");
}
and it does invoke this function which will take me to the previous html page in the window history, only thing is i have to click it twice.
-
Moonlight shadow
Right, got ya, sorry.
Could you show it to us so we can see it for our selves?
TE
-
Senior Member
Man, I'm having the same problem right now. I am searching for an answer, but its not looking good. It really should work.
And whoever said that you can't call native javascript methods from within Flash is wrong.
The future belongs to those who prepare for it today.
-
I call javascript native commands from within flash, it works fine, but the problem was with this particular command.
However i didnt find the solution and did this, you can do this if you want.
fscommand works fine for Internet explorer, and for netscape we need to call a function written in javascript(it works fine in netscape).
While loading the swf, i am checking the browser type and inserting the value into the swf.
I write both fscommand as well as a javascript function in the html page. And call the function depending on the browser type.
Hope i am clear and this one helps you too.
-
Senior Member
Actually, I just solved it. You have to put the getURL on both the press and release events. It's a hack, but it works great.
The future belongs to those who prepare for it today.
-
I remember there was one more problem, if it works, it erases the page from the history. you can not come back to the page from where you click "back". If it doesn't matter for you project, then what you did is good enough.
-
I know this is an old thread but just thought I'd add some extra things I've noticed (spent ages trying to fix problem b4 finding this thread).
Even if you use a getURL("javascript: alert('whatever')") command within flash it seems to disrupt any calls to the history.back() javascript function. Say you have a simple Input type button in the HTML page with an onClick('history.back()') command, this will work fine until you click on the .swf button (which with the above code successfully calls an alert box). If you then click on the HTML input button nothing happens until you click on another .swf button. Any getURL() commands on the Flash button are ignored and the previous onClick('history.back()') Javascript command gets invoked instead!
This is pretty wierd, but seems like IE 6 is going into a loop (when javascript is called from Flash) and it's only when another command is called that the loop ends and the original command is invoked.
Maybe somebody more clever than me can use this to find out what's really happening.
Sorry if it's as clear as mud. I might get some example files up so people can see what I mean, when I've got a mo...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|