View Full Version : not playing when published
dominick100
04-07-2003, 01:02 AM
OK, here's the deal.
Movie with a preloader.
I test the movie, works fine.
I publish the movie, and open the resulting HTML file. I only get the movie's background. It doesn't play. I right-click the movie and click "play" and it plays fine. The same thing happens when I export the .swf and put it right in an HTML file in Dreamweaver.
If I delete the preloader scene and publish it (or export it and put it in the HTML in Dreamweaver), it workd fine.
Has anyone ever seen this happen before? The swf itself ALWAYS works fine, it's only when it's embedded in an HTML file (with the preloader) that it gets messed up.
Here is the one with the preloader removed:
www.braxtonfalls.com
With the preloader:
www.loobis.com/tests/braxtonbase2.html
Once again, the .swf file in that movie works fine when I open it on it's own.
Billy T
04-07-2003, 01:26 AM
post the preloader code
maybe you have gotoAndStop instead of gotoAndPlay...
strange that it works on it own...
dominick100
04-07-2003, 01:30 AM
Frame 1:
total_bytes = _root.getBytesTotal();
loaded_bytes = _root.getBytesLoaded();
remaining_bytes = total_bytes-loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
percentdisplay = percent_done+"%"
bar.gotoAndStop(percent_done);
if (_framesloaded = _totalframes) {
gotoAndPlay ("mainmovie", 1)
}
Frame 2:
gotoAndPlay(1)
And I checked the publish settings. "Pause at Start" is NOT checked.
Thanks.
CyanBlue
04-07-2003, 01:40 AM
The first thing I have spotted...
if (_framesloaded = _totalframes) {
You need == in if condition not =...
Try it and see if it makes any differences... ;)
Billy T
04-07-2003, 02:17 AM
anyone else not getting topic reply notifications?
CyanBlue
04-07-2003, 02:32 AM
I'm getting it fine... Maybe croc took it??? :D
Billy T
04-07-2003, 02:58 AM
nah I trained croc to just eat spam...
dominick100
04-07-2003, 03:53 AM
That did it!
Thanks!
Still strange that it worked when testing but not when embedded.
Thanks again!
CyanBlue
04-07-2003, 04:15 AM
Well... Simple fact...if (A = B)
{
// true block
}
else
{
// false block
}What happens is (A = B) assigns B to A and that ALWAYS is true, so 'true block' always gets executed no matter what condition you think you are putting right there... That 'false block' is just sitting there doing nothing in that case...
Abit more clear??? ;)
dominick100
04-07-2003, 12:40 PM
I understand completely why it DIDN'T work ( I miss a lot of simple things like that). I guess what I didn't get was why it DID work when I only tested , and did not work only when embedded in an HTML file.
Also, I would think that if the if...then statement was screwed up, that it would still show the preloader bar, but in this case, only the BG showed up.
ALSO, why would right-click > Play Movie play the movie normally if the if...then was not working?
That's wierd to me.
Billy T
04-07-2003, 01:45 PM
whats happening is when you put it online, as soon as the preloader frames load the movie is jumping to the main scene and is told to play
however frame 2 and on of the main scene have not yet loaded so it just stops
cheers
MiCInc
04-08-2003, 12:04 AM
I had a similar problem:
Flash game with two scenes: "Init" and "Scene 1"
The SWF itself worked perfectly, but when placed in a html file the window stayed blank, with only 2 parts of the introscreen visible.
Then I removed the "Init" scene and inserted those frames at the beginning of "Scene 1", WITHOUT changing any code or graphics, and suddenly the html worked!!
:confused:
Init
Frame 1: no label
__gotoAndPlay("Scene 1", "Start");
Scene 1
Frame 1: labelled "Start"
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.