?
Solved

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

Posted on 2007-08-11
11
Medium Priority
?
1,553 Views
Last Modified: 2013-11-05
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 (http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/Q_21590935.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!?
0
Comment
Question by:TheFuteballer
  • 5
  • 5
11 Comments
 
LVL 9

Expert Comment

by:Jakob_E
ID: 19676505
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
0
 
LVL 1

Author Comment

by:TheFuteballer
ID: 19676652
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)
0
 
LVL 9

Expert Comment

by:Jakob_E
ID: 19676853
Can you upload your flv file - then I'll take a look

~ Jakob E
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:TheFuteballer
ID: 19676911
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
0
 
LVL 9

Expert Comment

by:Jakob_E
ID: 19676977
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 :)
0
 
LVL 9

Accepted Solution

by:
Jakob_E earned 2000 total points
ID: 19677725
Ok I've now looked at the file and the problem is not in your script...
It is in the properties of your png image (pic01).

To fix it right click on the pic01 in your library then select properties.
Now check the use document default quality and clock ok....
Then it works :)

I'm not sure why it acts this way - but perhaps it is due to a png
image being treated as a jpg while overriding the default.

~ Jakob E


Ps. If you find your flash getting stuck on a wrong frame you can
trace the specific frame by adding this script to the first frame
of your movie: this.onEnterFrame=function(){trace(_currentframe)}

Pps. Since you are not using playanimation=true simply check if it is false
if(!playanimation){this.gotoAndStop(202);}



0
 
LVL 1

Author Comment

by:TheFuteballer
ID: 19677959
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)
0
 
LVL 9

Expert Comment

by:Jakob_E
ID: 19678778
I've made the changes in the file and mailed it to you - try it out.

~ Jakob E
0
 
LVL 1

Author Comment

by:TheFuteballer
ID: 19713983
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!
0
 
LVL 1

Author Comment

by:TheFuteballer
ID: 19792573
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!
0
 

Expert Comment

by:madpiotr
ID: 23628068
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
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question