Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Skipping Frames in Flash

Status
Not open for further replies.

lee20

IS-IT--Management
Jan 30, 2004
17
0
0
US
Okay, I have a flash header at the top of a web page. When the page loads, the text and graphics fade into the picture with motion tweens.

The problem is, when I goto another page the header file does all the motion and cool effects again. I want it to only do the effects the first time the page loads.

How would I go about skipping all of those frames after the 1st time?

thanks,
lee20
 
Why don't you just put your header in an own frame so it won't be reloaded?

If you prefer skipping frames you should have a look at this:



regards

tektips.gif
 
Well generally placing the header in it's own frame would be an easy solution. However, I try to not use frames because of personal preference.
I'm going over that url now.
thanks-
lee20
 
Think you could simply use something like the following...

Since you must be embedding that header in each page, simply try to add this code in your header.fla's first frame...

if(this._url != " this.gotoAndStop(50);
}

Replace yourserver and index,html with the appropriate ones.

I use 50, but obviously replace that with the appropriate frame number at the end of your tweens and effects.
You could also use a labeled frame as target...

if(this._url != " this.gotoAndStop("intro_viewed");
}
 
Forgot to disable TGML...

Here it is again...


Think you could simply use something like the following...

Since you must be embedding that header in each page, simply try to add this code in your header.fla's first frame...

if(this._url != " this.gotoAndStop(50);
}

Replace yourserver and index,html with the appropriate ones.

I use 50, but obviously replace that with the appropriate frame number at the end of your tweens and effects.
You could also use a labeled frame as target...

if(this._url != " this.gotoAndStop("intro_viewed");
 
Hmm. I don't know what the heck I'm doing wrong. But when I do what you said, I get a blank header. If I hit play it scrolls through it.

I would love to figure it out. But what would one of you guys charge me if I was to shoot you the header file and have you set it to skip to frame 76 after it's first load?
I'm willing to pay a little money, and what takes me hours probably won't take someone more savvy in flash just minutes.
Let me know if you can do this for me and I'll shoot some money to ya via pay-pal.

Thanks,
lee20
 
You can e-mail the .fla, and maybe the main html and one of the other page's html, zipped up and in MX only format, not MX2004. You'll find my address if you hit my handle above.
As of now, I'll do it for the fun of it. Haven't started charging yet!
 
My bad!
The _url would in fact hold the .swf rather than the .html in which the .swf is embedded.

So this line would do it...

if(this._url != " this.gotoAndStop(50);
}

...Assuming it was a copy of banner, banner2.swf, that was embedded in every other page but the main page.

But at that point, may be easier to just embed a reduced copy of banner.swf (rid of the frames you don't want to be seen) and simply embed that copy in all other pages than the main page.
 
Well right now, I have two copies of the swf. One with the intro and one without. I'm starting a session after the header is displayed. It looks something like this:

"header2.swf = reduced copy of header (no intro)"

if($session == '1') $header = 'header2.swf';
else $header = 'header.swf';

<embed.....etc..$header>etc

This seems to work fine. But isn't this redundant? header2.swf is 64 kb its self without the intro. That isn't a whole lot, but it's 64 kb that has allready been passed to the visitor.

oldnewbie.....I'm gonna ask you to do something for me for free when I'm getting paid for it. So let me know, even if it's just $5, I'm not gonna hand out free work, although that is a nice jesture on your part.

-thanks
lee20
 
Ummmmmmmm! My bad again I guess. If I understand you correctly, you're right, using 2 different banners (.swfs), would in fact men that both movies would have to be dowloaded at least once (before they were cached), even if the second one only held reduced content of the first one.

An alternative (which I've tested, and works!) would be to use the same banner.swf on all pages but to append to it a variable (in the object & embed tags) differently set on the main page and in all the other pages.

Something on the main page like...

<PARAM NAME=movie VALUE=&quot;banner.swf?display=notviewed&quot;>
(and in the embed tag also)

Then in all other pages...

<PARAM NAME=movie VALUE=&quot;banner.swf?display=viewed&quot;>
(and in the embed tag also)

But to have a first frame action as follow on the first frame of the banner.fla:

this.onEnterFrame = function(){
if(_level0.display == &quot;notviewed&quot;){
this.gotoAndPlay(2);
}
if(_level0.display == &quot;viewed&quot;){
this.gotoAndStop(76);
}
};
stop();

If you can't get it going, you can e-mail me the banner.fla, and the main html along with one of the other html pages, and I can probably set it up for you. Hit my handle above for my e-mail. The whole package should be zipped up and the .fla in MX only format, not MX2004.

PS:
If you insist, I do have a PayPal account, but to be frank about it, I've never used it to collect money, so I don't even know how it works that way. It seems I have to send you an e-mail (through PayPal), which would direct you to my account in some way, so you can make the payment.
 
Well allright. Let me give this a shot. Sounds like it should work. I'll let you know if I get it to work. If not I'll shoot you the zip file.
Thanks alot,
lee20
 
Okay, I got it to work for when I test the movie inside of Flash MX. When I set display = viewed or notviewed withing the header file. But when I open it in my browser I get a blank header. If I right click and then hit play it scrolls through it. What am I doin wrong?

lee20
 
Sweet, I got it worked out. Finally! Thanks alot for the help. I'm sure I'll need more soon. Thanks thanks thanks!
lee20
 
Now is it possible to start a session inside the flash header at Frame 76? Perhaps I am starting a session in my php page and passing that value like this:
<param name='movie' value='header.swf?display=$display'>
then I start the session for $display
$_SESSION['display'] = 'viewed';

But I would rather start the session inside of the flash header, to be sure that the entire intro has played before starting the session. Possible??
thanks
lee20
 
I'm sorry can't answer that one... When it comes to server side scripting, it's like writing Chinese to me! I wouldn 't know where to start.
 
thanks anyways oldnewbie,
lee20
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top