-
menu that knows what html page its on
i have a menu in an html website, is there any actionscript i can add to the menu, so that it knows what page it is loaded on and does something depending on which page it is on
for example, to make it sound more clear i will set it out like this:
if webpage=page1 play MC5
if webpage=page2 play MC4
somthing like that
.note that i only put that up there as my own example, sort of as the script i need, of course it isnt reall and i made it up
hope someone can help, much thanks
-
Senior Member
-
thanks for answer,
i dont mean to *****... but could you explain it a little bit?
cheers
-
_url will only give you the address of the .swf
To get the full url use the javascript 'window.location.href'
gparis
-
The Flashman
or you can use backend scripts to pass the current page number to flash via QueryString...
i eat actionscripts for breakfast
-
heheh thanks everyone! but since i know no backend scripts or JS then i will just copy the swf and change it slightly , and have the seperate swfs for each page, its only 2 pages so this wont take long and will slove my problems. thanks anway
-
here's an example, for you or anyone searching on that topic:
The html (containing the query string, as earl223 suggested):
PHP Code:
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<TITLE>a</TITLE>
<SCRIPT LANGUAGE="JavaScript">
var ad;
ad= window.location.href;
</script>
</HEAD>
<BODY bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- URL's used in the movie-->
<!-- text used in the movie-->
<script>
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
document.write(' WIDTH="550" HEIGHT="400" id="a" ALIGN="">');
document.write(' <PARAM NAME=movie VALUE="a.swf?ad='+ad+'">');
document.write(' <PARAM NAME=quality VALUE=high>');
document.write(' <PARAM NAME=bgcolor VALUE=#FFFFFF>');
document.write('<embed src="a.swf?ad='+ad+'" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400" NAME="movie" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
document.write(' </EMBED>');
document.write(' </OBJECT>');
</script>
</BODY>
</HTML>
and an example in a flash file (set a dynamic var on _root with variable name 'ad')
code: stop();
path = "http://www.yourserver.com/";
switch (ad) {
case path :
this.gotoAndStop(1);
break;
case path+"index.html" :
this.gotoAndStop("label1");
break;
case path+"index2.html" :
this.gotoAndStop("label2");
break;
case path+"index3.html" :
this.gotoAndStop("label3");
break;
}
gparis
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
|