Link to home
Start Free TrialLog in
Avatar of TheFuteballer
TheFuteballer

asked on

Unable to get flash header not to reload on a new page

I am trying to get my flash header / nav menu to stop reloading on everypage and only show the intro part of it only on the main page. I've looked through some previous questions on EE and came across this solution which seemed to make a lot of sense (https://www.experts-exchange.com/questions/21590935/Flash-Headers-No-Reload-No-iFRAMES.html?sfQueryTermInfo=1+flash+gono+reload)

The code specified was the following:

"Within your <object></object> tags add:
<param name="FlashVars" value="goNo=<?php echo $goOrNo; ?>">

Anywhere in the <embed> tag add: FlashVars="goNo=<?php echo $goOrNo; ?>"

In index.php declare at the top of the page:
<?php $goOrNo = "go"; ?>

On all your other pages:
<?php $goOrNo = "no"; ?>

First frame in flash movie:
stop();
if (goNo == "no") {
gotoAndStop(#); // Put frame number or label to jumpt to to skip intro
} else {
play();
}
"

I followed the accepted solutions technique however as you can see in www.mcxlphotography.com/mcxl.php , the header stops but not at the frame it should (this isn't the main page by the way so it should go straight past the intro). This is stopping on approximately frame 20 (which is part of the intro) and not frame 190 where it should be stopping as I've specified on the first frame of the flash file (gotoAndStop(190) )


This shows that the code itself is working as its reading the stop(); and checking the variable but it doesn't gotoAndStop at the right frame! How can I fix this!?
Avatar of Jakob_E
Jakob_E
Flag of Denmark image

What you do should work...

Try using session cookies and flashvars to control your animation.
Then your flash will play only once... no matter what page the
user hits first.

<?php
// If no session cookie named showanimation exists create one
// with a true value. Else set the the value to false
if(!isset($showanimation)){ $showanimation="true";}
else{ $showanimation="false";}
setcookie("showanimation",$showanimation,0);
?>

Add the following to the tags including your flash movie on the page:
Object tag:
<PARAM NAME=FlashVars VALUE="playanimation=<?=$showanimation ?>">

Embed tag:
<EMBED src="yourflashfile.swf" FlashVars="playanimation=<?=$showanimation ?>"
... (other parameters)></EMBED>

In your flash movie add something like this (no stop() added):
if(playanimation){
  // Play the animation (just let flash play)
}else{
 // Don't play (jump to frame 190)
 gotoAndStop(190)
}

Give it a shot and see if it also solves your problem.
~ Jakob E


Best, Jakob E
Avatar of TheFuteballer
TheFuteballer

ASKER

hmm it does work better than the previous version but it still doesn't stop on the right frame (stops at about frame 60 or so) and also it never plays full intro from the beginning (even if i clear my cache and cookies and refresh the page)
Can you upload your flv file - then I'll take a look

~ Jakob E
the swf file is at

http:www.mcxlphotography.com/newtest/templates/bijan/header_final.swf

if you want the source send me an email through my profile
Your e-mail isn't public - or perhaps it's just me beeing blind...
You'll find mine in the comment text on my profile - hope you can see it :)
ASKER CERTIFIED SOLUTION
Avatar of Jakob_E
Jakob_E
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hmm it seems it is still not working for me :(

although it just checking that did cut down about 30 kb from the swf file (thanks for that haha) it still has the same problem. Oddly enough it seems to switch between stopping at frame 20 and frame 60 everytime I refresh, try for yourself (www.mcxlphotography.com/mcxl.php)
I've made the changes in the file and mailed it to you - try it out.

~ Jakob E
hmm it seems it's not working.. thanks for the effort though, I will make sure you get a split of the points at least Jakob!
I have decided to just go with the frames method as it seems to be a problem with my flash file. Thank you for all of your help Jakob!
Hallo Jakob
could you try with my file?
i also do not want to reaload this in my header every time i see my pages?

the file is there:
piotrek.de/pioflash.fla

thanks