FORUMS: list search recent posts

AS3 button to activate browser back button?

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mary Waitrovich
AS3 button to activate browser back button?
on Feb 9, 2011 at 7:04:02 pm

Is it possible to make a button in AS3 that activates (or does the same thing as) the browser's back/forward buttons? If so how?

Thanks much,

Mary Waitrovich
Media Plus You, LCC
http://www.mediaplusyou.com


Return to posts index

Mike Smith
Re: AS3 button to activate browser back button?
on Feb 9, 2011 at 9:33:32 pm

To do this you have to communicate from your swf the browser, using Actionscript to call a javascript function. There are different ways of communicating with the browser ; if programming is your thing this may get you started http://codingrecipes.com/calling-a-javascript-function-from-actionscript-3-...

or this might give a bit more depth.

http://books.google.co.uk/books?id=WiedhiREmZkC&pg=PA478&lpg=PA478&dq=AS3+b...

This might get you started on javascript to back button, if you need it. http://www.exforsys.com/tutorials/javascript/javascript-history-object-prop...


Return to posts index

demetri tashie
Re: AS3 button to activate browser back button?
on Feb 10, 2011 at 3:15:03 am

exactly. externalInterface is the way to go if you want to emulate the 'back button' of the browser.

this simple code makes it work.
in flash:
import flash.external.ExternalInterface;
function myAS3function(event:Event):void {
ExternalInterface.call("goBack");
}


and in your html ( with in script tags in the head )
function goBack(){
history.go(-1);
}


where -1 takes you back 1 page in your browser's history.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]