Jump to content
GreenSock

jguthrie

SecurityError when loading in a youtube video and tweening..

Recommended Posts

I didnt know if I should post this in loading or tweening....

 

So I am loading in another swf with LoaderMax to play videos through youtube in my movie. I am also animating objects at the same time in the swf that is loading in the youtube swf. For some reason, this is causing a security error. (If I dont load the swf but animate, no error. If I dont animate but load the swf, no error. But both together. Error)

 

Not sure how to fix this. Error Msg:

SecurityError: Error #2121: Security sandbox violation: BitmapData.draw: http://www.mydomain.com.au/facebook/FacebookCommunityTab.swf cannot access http://s.ytimg.com/yt/swfbin/watch_as3-vflFkxRDW.swf. This may be worked around by calling Security.allowDomain.
at flash.display::BitmapData/draw()
at com.greensock.plugins::MotionBlurPlugin/set changeFactor()
at com.greensock::TweenMax/renderTime()
at com.greensock.core::SimpleTimeline/renderTime()
at com.greensock::TweenLite$/updateAll()

 

Code for loading and animating:


private function setupVideoPlayer():void {
		//Loading in the video player
		var cntext:LoaderContext = new LoaderContext(true);
		_loader = new SWFLoader("YouTubeSingle.swf", { onComplete:onLoadSWFComplete, onError:onLoadSWFError, onSecurityError:onLoadSecurityError, onScriptAccessDenied: onLoadScriptError ,context: cntext} );
		addChild(_loader.content);
		_loader.load();
	}

private function onLoadSWFComplete(event:LoaderEvent):void {
		_youTubePlayer = _loader.rawContent;
		_youTubePlayer.x = 10;
		_youTubePlayer.y = 200;
	}
private function animateCommentsIn():void { //onComplete:onFinishTween
		TweenMax.allTo([comment1, comment2, comment4, comment5, comment3], 2, { bezierThrough:[ { x:449, y:490 }, { x:"-90", y: "225" } ], scale:.9, delay:.3, alpha:1, motionBlur:true, ease:Cubic.easeInOut }, .4 , onCompleteAll);
	}

 

Its also worth noting that none of the errors I am listening for are getting tripped.

Link to comment
Share on other sites

Hi Jeff, sounds like a cool project you are working on. Security issues are a bit out of my realm of expertise, but I have read something about how you can't do any BitmapData alterations on assets loaded from other domains (unless a cross-domain policy file exists granting permission). I'm seeing the BitmapData.draw throwing the error which may be caused by the motionBlur plugin. this is a long shot guess, but try removing the motionBlur and see what happens

 

Carl

 

http://www.actionscript.org/forums/show ... 3?t=117772

Link to comment
Share on other sites

Ya it works without the motionBlur but I really wanted that effect! :)

 

The weird thing is is that I am not doing the motionblur on the video player... it is happening in another part of the flash movie as the youtube player is loading in...

 

I can also wait until after the animation has finished and then add the movie... :|

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×