Jump to content
Search Community

joshuaMaverick

Members
  • Posts

    16
  • Joined

  • Last visited

joshuaMaverick's Achievements

0

Reputation

  1. http://www.mav-media.com/clients/JAV/src.zip contains the instructions, fla and swf I produced. Maybe my loader package is dated and has a bug :S Thanks yet again. Much, much appreciated.
  2. Damn, still not working correctly with the fla and instructions you gave me. Can I send you a zip of the package, maybe there is something else I'm missing? thanks so much for your help.
  3. Here are the videos http://www.mav-media.com/clients/JAV/bg.zip < contains the videos that should play sequentially. I can't seem to find a pattern as to why the videos are not playing. I had my array randomizing, so I took that off, but I still can't see any issues. The code you provided makes sense to me. All help GREATLY appreciated. Thank you!
  4. When it skips the videos, it seems to wait the duration of the video before it jumps to the next file. Also, I'm testing locally right now, so shouldn't they all be considered fully loaded? It's not the paths, because the videos that fail are never the same. However, after 3 tests it does seem like 10 of the 15 clips fail each time. 10 random videos, in a random order. I'd actually like it to attempt to load the sequence, but if the users connection is too slow, cycle through the array until it hits a completed clip. The clips are only 3 - 10 seconds long.
  5. Sweet! It's half working now. I did make some minor adjustments, just to the tween length etc. It's randomly not displaying certain videos, and quickly skipping over others :S. Thoughts on this would be helpful. Thank you so much for your efforts so far, it is HIGHLY appreciated. I'll be telling everyone I know to join the premium club. private function loadVideos(videoInput:XML):void { videoList = videoInput.children(); initArray = new Array(); for (var i:int = 0; i < videoList.length(); i++) { var videoElement:XML = videoList[i]; initArray.push("javAdmin/"+videoElement); } randomizeArray(initArray); } private function randomizeArray(array:Array):void { vidArray = new Array(); while (array.length > 0) { var r:int = Math.floor(Math.random() * array.length); vidArray.push(array[r]); array.splice(r, 1); } initPreload(); } private function initPreload(e:Event = null):void { queue = new LoaderMax({name:"mainQueue", onChildComplete:childCompleteHandler, maxConnections:2}); for (var i:int = 0; i < vidArray.length; i++) { queue.append(new VideoLoader(vidArray[i], {name:"vid"+i, container:this, width:stage.stageWidth, height:stage.stageHeight, alpha:0, visible:0, scaleMode:"proportionalInside", autoPlay:false})); } queue.load(); } private function childCompleteHandler(event:LoaderEvent):void { preloadCount++; if (preloadCount == 3) { showVideo(0); } } private function showVideo(index:uint):void { if (curVideoIndex != -1) { var old:VideoLoader = LoaderMax.getLoader(vidArray[curVideoIndex]) as VideoLoader; old.removeEventListener(VideoLoader.VIDEO_COMPLETE, videoCompleteHandler); TweenLite.to(old.content, .15, {autoAlpha:0}); //fade it out TweenLite.to(old, .15, {volume:0, onComplete:old.pauseVideo}); //fade the volume down and then pause the video. } curVideoIndex = index; trace("index: "+vidArray[index]); var video:VideoLoader = LoaderMax.getLoader(vidArray[index]) as VideoLoader; addChild(video.content); //brings the video to the top of the display list. video.addEventListener(VideoLoader.VIDEO_COMPLETE, videoCompleteHandler); video.gotoVideoTime(0, true); TweenLite.to(video.content, .15, {autoAlpha:1}); TweenLite.to(video, .15, {volume:1}); } private function videoCompleteHandler(event:LoaderEvent):void { var nextIndex:int = curVideoIndex + 1; if (nextIndex >= vidArray.length) { nextIndex = 0; } showVideo(nextIndex); }
  6. I'm trying to use the video loaders to create a playlist of videos, so that videos continuously load, and play sequentially. Ideally, I'd like it to work in the following manner: 1. begin preloading an array of videos 2. when 3 videos are completed loading, begin playing the first video 3. when a video is complete, begin to play the next video 4. when the videos are done, begin the list again. I'm going through the docs and I've done the following: private function initPreload(vidArray:Array):void { queue = new LoaderMax({name:"mainQueue", onChildComplete:childCompleteHandler}); for (var i:int = 0; i < vidArray.length; i++) { queue.append(new VideoLoader(vidArray[i], {name:"vid"+i, container:this, width:400, height:300, scaleMode:"proportionalInside", autoPlay:false})); } queue.load(); } private function childCompleteHandler(event:LoaderEvent):void { cNum++; if (cNum == 2) { queue.getLoader("vid0").playVideo(); } } So here I'm just trying to get the first video to play, once 3 videos have been finished loading. But instead, three videos kind of play/appear when i test this :S Thank you.
  7. Okay, so I'm back on this project. I've moved around declarations, but now it seems to be locking to the top left corner again. The "view" is a SiteView that the framework creates. Any and all help would be greatly appreciated http://www.djspoonz.com/beta/ Thank you. /***************************************************************************************************** * Gaia Framework for Adobe Flash ©2007-2009 * Author: Steven Sacks * * blog: http://www.stevensacks.net/ * forum: http://www.gaiaflashframework.com/forum/ * wiki: http://www.gaiaflashframework.com/wiki/ * * By using the Gaia Framework, you agree to keep the above contact information in the source code. * * Gaia Framework for Adobe Flash is released under the GPL License: * http://www.opensource.org/licenses/gpl-2.0.php *****************************************************************************************************/ package { import com.gaiaframework.core.GaiaMain; import com.greensock.easing.Expo; import com.greensock.TweenLite; import com.greensock.TweenProxy3D; import flash.display.Sprite; import flash.display.StageScaleMode; import flash.display.StageAlign; import flash.events.Event; import flash.geom.Vector3D; public class Main extends GaiaMain { public var distx:Number = 0; public var disty:Number = 0; public var myProxy:TweenProxy3D; public function Main() { super(); alignSite(1200, 800); siteXML = "xml/site.xml"; } override protected function onAddedToStage(event:Event):void { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; super.onAddedToStage(event); myProxy = TweenProxy3D.create(view); myProxy.registration = new Vector3D(stage.stageWidth / 2, stage.stageHeight / 2, 0); addEventListener(Event.ENTER_FRAME, loop); } private function loop(e:Event):void { if (mouseX < stage.stageWidth / 2 - 500) { distx = 0 } if ((mouseX > stage.stageWidth / 2 - 500) && (mouseX < stage.stageWidth / 2 + 500)) { distx = (mouseX - ((stage.stageWidth - 1000) / 2)) / 1000; } if (mouseX > stage.stageWidth / 2 + 500) { distx = 1 } if (mouseY < stage.stageHeight / 2 - 300) { disty = 0 } if ((mouseY > stage.stageHeight/2 - 300) && (mouseY < stage.stageHeight/2 + 300)) { disty = (mouseY - ((stage.stageHeight - 600) / 2)) / 600; } if (mouseY > stage.stageHeight / 2 + 300) { disty = 1 } TweenLite.to(myProxy, 1, {rotationY: ( -6.5 + (13 * distx)), rotationX: (6.5 - (13 * disty)), ease:Expo.easeOut } ); } override protected function onResize(event:Event):void { myProxy.x = Math.round((stage.stageWidth - __WIDTH) / 2); myProxy.y = Math.round((stage.stageHeight - __HEIGHT) / 2); //myProxy.registration = new Vector3D(stage.stageWidth / 2, stage.stageHeight / 2, 0); } } }
  8. I'm going to get back to you on that. I'm using the gaia framework, while trying to learn as3 lol. Very strange business. Thanks for the help so far, I really appreciate it.
  9. I actually tried that first to no avail. :S /***************************************************************************************************** * Gaia Framework for Adobe Flash ©2007-2009 * Author: Steven Sacks * * blog: http://www.stevensacks.net/ * forum: http://www.gaiaflashframework.com/forum/ * wiki: http://www.gaiaflashframework.com/wiki/ * * By using the Gaia Framework, you agree to keep the above contact information in the source code. * * Gaia Framework for Adobe Flash is released under the GPL License: * http://www.opensource.org/licenses/gpl-2.0.php *****************************************************************************************************/ package { import com.gaiaframework.core.GaiaMain; import com.greensock.easing.Expo; import com.greensock.TweenLite; import com.greensock.TweenProxy3D; import flash.display.StageScaleMode; import flash.display.StageAlign; import flash.events.Event; import flash.geom.Vector3D; public class Main extends GaiaMain { public var distx:Number = 0; public var disty:Number = 0; public var myProxy:TweenProxy3D; public function Main() { myProxy = TweenProxy3D.create(view); myProxy.registration = new Vector3D(stage.stageWidth/2, stage.stageHeight/2, 0); addEventListener(Event.ENTER_FRAME, loop); super(); siteXML = "xml/site.xml"; } override protected function onAddedToStage(event:Event):void { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; alignSite(1000, 600); super.onAddedToStage(event); } override protected function onResize(event:Event):void { view.x = Math.round((stage.stageWidth - __WIDTH) / 2); view.y = Math.round((stage.stageHeight - __HEIGHT) / 2); } private function loop(e:Event):void { if (mouseX < stage.stageWidth / 2 - 500) { distx = 0 } if ((mouseX > stage.stageWidth / 2 - 500) && (mouseX < stage.stageWidth / 2 + 500)) { distx = (mouseX - ((stage.stageWidth - 1000) / 2)) / 1000; } if (mouseX > stage.stageWidth / 2 + 500) { distx = 1 } if (mouseY < stage.stageHeight / 2 - 300) { disty = 0 } if ((mouseY > stage.stageHeight/2 - 300) && (mouseY < stage.stageHeight/2 + 300)) { disty = (mouseY - ((stage.stageHeight - 600) / 2)) / 600; } if (mouseY > stage.stageHeight / 2 + 300) { disty = 1 } //TweenLite.to(myProxy, 1.5, { x:stage.stageWidth/2, y:stage.stageHeight /2, rotationY: ( -6.5 + (13 * distx)), rotationX: (6.5 - (13 * disty)), ease:Expo.easeOut } ); } } } Gives me this error: TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.greensock::TweenProxy3D() at com.greensock::TweenProxy3D$/create() at Main()
  10. So I tried to move the proxy and registration to the constructor in the following way.. public class Main extends GaiaMain { public var distx:Number = 0; public var disty:Number = 0; public var myProxy:TweenProxy3D; public function Main() { myProxy.create(view); myProxy.registration = new Vector3D(stage.stageWidth/2, stage.stageHeight/2, 0); addEventListener(Event.ENTER_FRAME, loop); super(); siteXML = "xml/site.xml"; } But clearly something is incorrect as I get a Error #1009 Cannot access a property or method of a null object reference...
  11. Thanks for the reply. Whenever you get a chance, I'd greatly appreciate it. I'm new to as3, and I'm trying to piece things together as I go. I'm using it with the Gaia framework and it's like trying to learn 4 things at once. Where should I be placing the registration and details? Here is the whole main.as class. Thank you again, I really appreciate it. /***************************************************************************************************** * Gaia Framework for Adobe Flash ©2007-2009 * Author: Steven Sacks * * blog: http://www.stevensacks.net/ * forum: http://www.gaiaflashframework.com/forum/ * wiki: http://www.gaiaflashframework.com/wiki/ * * By using the Gaia Framework, you agree to keep the above contact information in the source code. * * Gaia Framework for Adobe Flash is released under the GPL License: * http://www.opensource.org/licenses/gpl-2.0.php *****************************************************************************************************/ package { import com.gaiaframework.core.GaiaMain; import com.greensock.easing.Expo; import com.greensock.TweenLite; import com.greensock.TweenProxy3D; import flash.display.StageScaleMode; import flash.display.StageAlign; import flash.events.Event; import flash.geom.Vector3D; public class Main extends GaiaMain { public var distx:Number = 0; public var disty:Number = 0; public function Main() { addEventListener(Event.ENTER_FRAME, loop); super(); siteXML = "xml/site.xml"; } override protected function onAddedToStage(event:Event):void { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; alignSite(1000, 600); super.onAddedToStage(event); } override protected function onResize(event:Event):void { view.x = Math.round((stage.stageWidth - __WIDTH) / 2); view.y = Math.round((stage.stageHeight - __HEIGHT) / 2); } private function loop(e:Event):void { var myProxy:TweenProxy3D = TweenProxy3D.create(view); myProxy.registration = new Vector3D(stage.stageWidth/2, stage.stageHeight/2, 0); if (mouseX < stage.stageWidth / 2 - 500) { distx = 0 } if ((mouseX > stage.stageWidth / 2 - 500) && (mouseX < stage.stageWidth / 2 + 500)) { distx = (mouseX - ((stage.stageWidth - 1000) / 2)) / 1000; } if (mouseX > stage.stageWidth / 2 + 500) { distx = 1 } if (mouseY < stage.stageHeight / 2 - 300) { disty = 0 } if ((mouseY > stage.stageHeight/2 - 300) && (mouseY < stage.stageHeight/2 + 300)) { disty = (mouseY - ((stage.stageHeight - 600) / 2)) / 600; } if (mouseY > stage.stageHeight / 2 + 300) { disty = 1 } TweenLite.to(myProxy, 1.5, { x:stage.stageWidth/2, y:stage.stageHeight /2, rotationY: ( -6.5 + (13 * distx)), rotationX: (6.5 - (13 * disty)), ease:Expo.easeOut } ); } } } Thank you again. And again.
  12. Ahh, not so much. For some reason, the tween isn't working correctly. http://www.mav-media.com/clients/SPN/bin/ As you can see the rotation isn't actually working correctly. It's not rotating enough on the right side, or is rotating too much on the left. Here is my code: override protected function onResize(event:Event):void { view.x = Math.round((stage.stageWidth - __WIDTH) / 2); view.y = Math.round((stage.stageHeight - __HEIGHT) / 2); } private function loop(e:Event):void { var myProxy:TweenProxy3D = TweenProxy3D.create(view); myProxy.registration = new Vector3D(stage.stageWidth/2, stage.stageHeight/2, 0); if (mouseX < stage.stageWidth / 2 - 500) { distx = 0 } if ((mouseX > stage.stageWidth / 2 - 500) && (mouseX < stage.stageWidth / 2 + 500)) { distx = (mouseX - ((stage.stageWidth - 1000) / 2)) / 1000; } if (mouseX > stage.stageWidth / 2 + 500) { distx = 1 } if (mouseY < stage.stageHeight / 2 - 300) { disty = 0 } if ((mouseY > stage.stageHeight/2 - 300) && (mouseY < stage.stageHeight/2 + 300)) { disty = (mouseY - ((stage.stageHeight - 600) / 2)) / 600; } if (mouseY > stage.stageHeight / 2 + 300) { disty = 1 } TweenLite.to(myProxy, 1.5, { x:stage.stageWidth/2, y:stage.stageHeight /2, rotationY: ( -6.5 + (13 * distx)), rotationX: (6.5 - (13 * disty)), ease:Expo.easeOut } ); } Any help is greatly appreciated here. Thank you,
  13. Okay, got it working!... or so I thought. Everything works great, but suddenly, everything just dissappears :S. I tried tracing the values I'm passing into the rotationX and rotationY, but no problems there... thoughts :S? Thanks!
  14. Hrm, just tried to open that swf, gave me a bunch of errors :S
×
×
  • Create New...