PDA

View Full Version : Difference between CS3 API FlashPlayer and FlashPlayer in a browser



Sparda
April 9th, 2009, 06:16 AM
Hello all,

I picked up enough AS3 recently to create some advertising banners and they work perfectly when I test the movie within CS3 by using ctrl+enter. I uploaded the created swf on the website and experienced lots of weird problems like child mcs stopping to play after a while or movies not playing till the end etc.. On some movies, they will play properly if you reload the website, on some others (the one which doesnt play till the end) that wont fix the problem either. The banners' filesizes are also around 8KB for example and include only text and vectors.

I published my movie by letting Flash create an html file, and the exact same problems are occurring there aswell. I mean I got strict mode and everything turned on in Flash but I'm not getting any errors at all when testing the movie. I also dont see any visual errors. It's just the swf acting differently in a browser.

So I'm trying to figure out what the difference between the flashplayer used by CS3 and the one in firefox is for example. I got the latest flashplayer (10 r22) on firefox and it seems that CS3 is using the flashplayer 9 (I'm not sure about this but its the player I found in the CS3 folder).

I searched over 300+ results here on the forums and came across these posts by Senocular:


Its an AS3 only issue. AS3 is completely different. In fact there are a lot of AS3 timeline bugs in Flash Player 9 (most of which have been fixed for Flash Player 10)
Just FYI, Playing your SWF published for Flash Player 9 in the Flash 10 player will not fix your problems. You will have to publish to Flash Player 10 (requiring people to have Flash Player 10 to see your SWF). You're best off just looking for a workaround now.I'm using timeline based tweens (I know it sucks and I did this mostly on the first banners I created and started using the tween classes built in Flash later on when I learned more AS3) so wondering if this is the problem.

Does the last quote mean that I would need to work with CS4 to benefit from the fixes or should I try to update CS3?

Edit: Looks like there aren't any updates for Flash CS3 at all (only for flashplayer 9).

luiner
April 9th, 2009, 07:10 AM
try your banners for IE version (Are you using debug version?) and post if you have same problems...

Sparda
April 9th, 2009, 07:28 AM
Just tested, and exact the same problem in Internet Explorer 7. I'm not sure about the flashplayer on IE but looked like 9. I'm not sure what you mean by debug version though? Is it the publish setting where you allow debugging?

luiner
April 9th, 2009, 08:54 AM
no, there is two version on flash player, one is with second without debugger. But if your problem is in IE also it looks like problem is somewhere else. I will need to see code to say something about

senocular
April 9th, 2009, 09:41 AM
If you're using Flash CS3, the timeline issues shouldn't be your problem. As in one of your quotes of me, the changes in Flash Player 10 require that you publish your SWF for Flash Player 10 which is something you can't do in Flash CS3. Since you're publishing to 9, Flash Player 10 will play that SWF in what is essentially "v9 compatibility mode" making the behavior the same as though it were played in Flash Player 9 - for the most part. Security changes do not get version checked, which could be a problem for you. There have been some security changes in Flash Player 10, most of which should be listed here:
http://www.adobe.com/devnet/flashplayer/articles/fplayer10_security_changes.html

Also, as far as security goes, and this is a big difference between the player in Flash and the player in the browser, is that in Flash CS3 (and all other versions of Flash), the player is run in a local trusted sandbox. This means that player basically has access to everything - your computer's file system as well as the network. Normally, for security reasons, SWFs can only access one or the other. This prevents malicious SWFs from grabbing data from your harddrive and uploading it to some database on the web. Flash opens this up allowing both so that developers can more easily test their applications. And since they're in control of the content, there should be no threat. Problems with this difference pretty much only come into play when you're loading something into your SWF from an external source, which to me, it doesn't seem like you're doing.

At this point my suggestion is just to dig in and try to pinpoint the place where your movie(s) fail. It can be a little difficult to know why without really knowing the specifics of what.

Sparda
April 9th, 2009, 10:14 AM
First of all, thanks for your replies. :) I will try to provide the .fla but it's very embarrassing how I "coded" some of it, since I know how to do it a bit better by using custom tween classes instead of timeline based tweens (also to not scatter all the actionscript across different frames :puzzle:).

I have absolutely no problem if Flash shows me some error messages while developing. In that case, I know that I made a mistake and can figure out quickly where it is. I wouldn't be suprised either if the movie wouldnt be displayed at all. It's just that there are no errors, everything running fine in flashplayer but only when it's embedded into an html file.

Flash didn't give me any errors on the following code either but it seemed to kill the movieclip playback after a while in the browser (I bet it's some noob mistake similar to an endless loop):


var timer:Timer = new Timer(1,1);
timer.addEventListener(TimerEvent.TIMER, fadeIn);
timer.start();

function fadeIn(e:Event):void {
var arrow1:TransitionManager = new TransitionManager(arrowMC);
arrow1.startTransition({type:Fade, direction:Transition.OUT, duration:0.5, easing:Linear.easeOut});
arrow1.addEventListener("allTransitionsOutDone", fadeOut);
}

function fadeOut(e:Event):void {
var arrow1:TransitionManager = new TransitionManager(arrowMC);
arrow1.startTransition({type:Fade, direction:Transition.IN, duration:0.5, easing:Linear.easeIn});
arrow1.addEventListener("allTransitionsInDone", fadeIn);
}I changed the above code by removing the event listener in fadeOut and making the timer call fadeIn endlessly, which seemed to work better.

So can one say that even Flash doesn't show any errors and plays the movie fine in the CS3 flashplayer, it can have performance or playback problems in a browser if there are some kind of "logic" problems? :crazy:

Sen - I came across a lot of threads regarding loading external swfs in combination with the security changes but I only have a single swf. There is nothing beeing loaded inside.

Another thing which came to my mind is, if I'm supposed to have a preloader for everything? Even if the swf's size is like 8KB?


(I will try to comment the .fla file first since I can't expect you guys to figure out what the heck I was trying to do in your free time.)