Graphics Reference
In-Depth Information
EXAMPLE 9.2
Extra bits added to your HTML when using the
Flash with Named
Anchors
template
...
< script language= JavaScript >
// This is only needed for Netscape browsers.
function flashGetHref() { return location.href; }
function flashPutHref(href) { location.href = href; }
function flashGetTitle() { return document.title; }
function flashPutTitle(title) { document.title = title; }
< /script >
...
< !--bookmarks used in the movie-- >
< a name= home >< /a >
< a name= about >< /a >
< a name= contact >< /a >
...
Now getting back to the query string I talked about in the pre-
vious section, you could potentially do much more than just jump
to a frame on the timeline. Let
s say you want to run some code
before you take the user to a given page/section and that code
needs to be completely different, depending on the value of the
variable in the query string. Or maybe there are cases where you
don
'
t even want to change the page but you do want to run some
code. Example 9.3 should give you an idea as to how you might
like to handle the issue yourself.
'
EXAMPLE 9.3
Handling deep linking with a switch statement
switch(stage.loaderInfo.parameters.p){
case home :
gotoAndStop( homePage );
break;
case about :
someFunction();
gotoAndStop( aboutUs );
break;
case contact :
launchContactForm();
break;
default;
break;
}
Search WWH ::




Custom Search