-
html link to specific point in flash
My FLASH site is set up by having 4 sections each with a IF TRUE PLAY FORWARD, if not PLAY BACKWARD.
I want an HTML link to open this site and play the "WORK" section that doesnt play from the beginning. The "ABOUT" section does.
How would I make this link in HTML that would make workSec="true" so that flash would play this section out instead of aboutSec?
THANKS A MILLION IN ADVANCE,
-manny
-could just be me though
mannyme80
-
I'm not solid on my CGI scripting, but if you have your SWF in an HTML page, embedded with, say, SWFObject, you could use PHP to send a variable to your SWF.
If your flash movie is located on the page www.mannyme80.com/flash/index.php, you could append to the URL a variable string of ?whichPage=1 or ?whichPage=work (I'd recommend associating each page with an integer, like my first example. Then, the PHP code would look something like this (though this is off the top of my head, and could be wrong, but it's a start for you):
var myFlash = new FlashObject(......
myFlash.addParam("scale", "noscale");
myFlash.addVariable("thePage", <?php echo $_POST["whichPage"]; ?> );
And to expand the PHP there:
<?php
echo $_POST["whichPage"];
?>
So, as you can see, instead of hard-coding a value into the 'addVariable' method of the FlashObject class, we're grabbing the posted variable in the URL string. You could link to this page from elsewhere, and just add that ?whichPage=1 to the href of the hyperlink.
Note that whichPage is the name I've given to the variable for the variable string, and thePage is the name of the variable I'm sending into the SWF. So, in your flash movie, you'd have to handle that variable and choose your first page accordingly, such as follows:
// Note that your thePage variable will be on the _root level.
var nPage:Number = parseInt(_root.thePage);
switch(nPage) {
case 1:
ShowWorkPage(); break;
case 2:
ShowAboutPage(); break;
default:
ShowAboutPage(); break;
}
-
And I notice I've just spent 10 minutes replying to a post that was made 8 years ago. I'm a happy man.
-
And now I've noticed that I actually misread the join date as the post date. F**k me.
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
|