Permalink
Browse files

Update to setSize method, setting of the api_version for later refere…

…nce and addition of LoaderContext for player load to allow for Bitmap.draw support.
  • Loading branch information...
1 parent d819f22 commit 2c8acdae15a8c499eb155d3abd215add36a2e39f @ryanhefner ryanhefner committed May 9, 2011
@@ -2,7 +2,8 @@
#SDK Properties
# Flex SDK
-sdkhome.sv.dir = YOUR FLEX SDK PATH
+#sdkhome.sv.dir = ${user.home}/Applications/flex_sdk_4.5.0.20967 [EXAMPLE]
+sdkhome.sv.dir = PATH TO FLEX SDK
bin.sv.dir = ${sdkhome.sv.dir}/bin
libs.sv.dir = ${sdkhome.sv.dir}/frameworks/libs
flashplayer.sv = ${sdkhome.sv.dir}/runtimes/player/mac/Flash\ Player.app
@@ -1,6 +1,6 @@
<report>
<scripts>
- <script name="/Users/ryanhefner/Documents/public_html/flash/flash_api_example/flash_api_example/src/com/vimeo/api/VimeoPlayer.as" mod="1301085490000" size="4123" optimizedsize="3936">
+ <script name="/Users/ryanhefner/Documents/public_html/player-api/actionscript/src/com/vimeo/api/VimeoPlayer.as" mod="1304973811000" size="4092" optimizedsize="3903">
<def id="com.vimeo.api:VimeoPlayer" />
<pre id="flash.display:Sprite" />
<dep id="flash.events:Event" />
@@ -13,9 +13,10 @@
<dep id="Math" />
<dep id="flash.events:TimerEvent" />
<dep id="flash.display:Loader" />
+ <dep id="flash.system:LoaderContext" />
<dep id="flash.geom:Point" />
</script>
- <script name="/Users/ryanhefner/Documents/public_html/flash/flash_api_example/flash_api_example/src/com/vimeo/example/ExampleProject.as" mod="1301084391000" size="577" optimizedsize="553">
+ <script name="/Users/ryanhefner/Documents/public_html/player-api/actionscript/src/com/vimeo/example/ExampleProject.as" mod="1304973780000" size="577" optimizedsize="553">
<def id="com.vimeo.example:ExampleProject" />
<pre id="flash.display:Sprite" />
<dep id="flash.display:StageScaleMode" />
@@ -38,6 +39,7 @@
<ext id="flash.events:TimerEvent" />
<ext id="flash.display:Sprite" />
<ext id="flash.display:Loader" />
+ <ext id="flash.system:LoaderContext" />
<ext id="flash.system:Security" />
</external-defs>
</report>
Binary file not shown.
Binary file not shown.
@@ -17,20 +17,18 @@
*/
package com.vimeo.api
{
- import flash.net.URLRequest;
import flash.display.DisplayObject;
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
- import flash.events.TimerEvent;
import flash.events.MouseEvent;
+ import flash.events.TimerEvent;
import flash.external.ExternalInterface;
import flash.geom.Point;
- import flash.utils.Timer;
- import flash.system.ApplicationDomain;
+ import flash.net.URLRequest;
import flash.system.LoaderContext;
import flash.system.Security;
- import flash.system.SecurityDomain;
+ import flash.utils.Timer;
public class VimeoPlayer extends Sprite {
@@ -70,9 +68,10 @@ package com.vimeo.api
this.setDimensions(w, h);
Security.allowDomain('*');
- Security.loadPolicyFile('http://api.vimeo.com/crossdomain.xml');
+ Security.allowInsecureDomain('*');
var api_param : String = '&js_api=1';
+ this.api_version = api_version;
//
if (fp_version != '9')
@@ -84,14 +83,18 @@ package com.vimeo.api
break;
}
}
-
- // var loaderContext : LoaderContext = new LoaderContext(true, ApplicationDomain.currentDomain, SecurityDomain.currentDomain);
+ else
+ {
+ this.api_version = 1;
+ }
var request : URLRequest = new URLRequest("http://api.vimeo.com/moogaloop_api.swf?oauth_key=" + oauth_key + "&clip_id=" + clip_id + "&width=" + w + "&height=" + h + "&fullscreen=0&fp_version=" + fp_version + api_param + "&cache_buster=" + (Math.random() * 1000));
+ var loaderContext : LoaderContext = new LoaderContext(true);
+
var loader : Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete, false, 0, true);
- loader.load(request);
+ loader.load(request, loaderContext);
}
public function destroy() : void
@@ -262,12 +265,7 @@ package com.vimeo.api
public function setSize(w:int, h:int) : void
{
this.setDimensions(w, h);
-
- var size : Object = new Object();
- size.width = w;
- size.height = h;
- moogaloop.size = size;
-
+ moogaloop.setSize(w, h);
this.redrawMask();
}
@@ -1,44 +1 @@
-package com.vimeo.example
-{
- import com.vimeo.api.VimeoPlayer;
-
- import flash.display.Sprite;
- import flash.display.StageAlign;
- import flash.display.StageScaleMode;
-
- /**
- * Example Project
- *
- * An example of how to use the VimeoPlayer class within your Flash AS3 projects.
- *
- * @author Ryan Hefner <ryan@vimeo.com>
- * @version $Id$
- */
- public class ExampleProject extends Sprite
- {
- // Elements
- private var player : VimeoPlayer;
-
-
- /**
- * constructor
- */
- public function ExampleProject()
- {
- super();
- init();
- }
-
- /**
- * Initiate the ExampleProject.
- */
- public function init() : void
- {
- stage.align = StageAlign.TOP_LEFT;
- stage.scaleMode = StageScaleMode.NO_SCALE;
-
- player = new VimeoPlayer('XXXX', 2, 640, 360);
- this.addChild(player);
- }
- }
-}
+package com.vimeo.example{ import com.vimeo.api.VimeoPlayer; import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; /** * Example Project * * An example of how to use the VimeoPlayer class within your Flash AS3 projects. * * @author Ryan Hefner <ryan@vimeo.com> * @version $Id$ */ public class ExampleProject extends Sprite { // Elements private var player : VimeoPlayer; /** * Constructor */ public function ExampleProject() { super(); init(); } /** * Initiate the ExampleProject. */ public function init() : void { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; player = new VimeoPlayer('XXXX', 2, 640, 360); this.addChild(player); } }}

0 comments on commit 2c8acda

Please sign in to comment.