Jump to content
Search Community

patrick.welborn

Members
  • Posts

    8
  • Joined

  • Last visited

patrick.welborn's Achievements

2

Reputation

  1. After having experimented with several VideoLoader load and unload techniques outlined in the forum I am still stuck on a troublesome video playback problem. When the following actions are taking, I get 'phantom' video playback. 1. set active = true to instantiate loaders 2. Loader onComplete displays video 3. set active = false to dispose loaders 4. again set active = true to re-instantiate loaders 5. Loader onComplete does not display video, but video's audio plays back. 6. again set active = false and loaders do not dispose I have been held up on this for sooooo many hours. Suggestions? package com.lightpail.view.component.region { import com.greensock.*; import com.greensock.events.*; import com.greensock.loading.*; import com.greensock.loading.core.*; import com.greensock.loading.data.*; import com.greensock.loading.display.*; import flash.display.Loader; import flash.display.Sprite; import flash.display.MovieClip; import flash.display.DisplayObject; import flash.events.DataEvent; import flash.events.MouseEvent; import flash.media.Sound; import flash.media.SoundMixer; import flash.media.SoundTransform; import flash.media.Video; public class GlobalPresence extends MovieClip { public static const NAME:String = "GlobalPresence"; public static const SWF_SUB_LOADER:String = "SWFSubLoader"; private var _active:Boolean = new Boolean(); public function GlobalPresence():void { LoaderMax.activate([imageLoader, VideoLoader]); } public function get active():Boolean { return _active; } public function set active(value:Boolean):void { switch(value){ case true: this.visible = true; this.alpha = 1; var globalPresenceBackground:ImageLoader = new ImageLoader("assets/image/global_presence_background.png", new ImageLoaderVars() .name("global_presence_background") .onComplete(globalPresenceBackgroundComplete) .x(0) .y(0) .width(1280) .height(720) .requireWithRoot(this.root) ); globalPresenceBackground.load(); break; case false: this.visible = false; this.alpha = 0; for(var i:int = this.numChildren; i>0; i--){ var mediaAsset:* = this.getChildAt(i-1); if(mediaAsset.toString() == "[object ContentDisplay]"){ switch(mediaAsset.rawContent.toString()){ case "[object Video]": trace(NAME + mediaAsset.rawContent.toString()); mediaAsset.loader.pauseVideo(); mediaAsset.loader.dispose(true, true); break; case "[object Bitmap]": trace(NAME + mediaAsset.rawContent.toString()); this.removeChildAt(i-1); break; } } } break; _active = value; } } private function progressUpdate(event:LoaderEvent) { dispatchEvent(new DataEvent(SWF_SUB_LOADER, true, false, event.target.progress)); } private function globalPresenceBackgroundComplete(event:LoaderEvent) { addChildAt(event.target.content, 0); var globalPresenceVideo:VideoLoader = new VideoLoader("assets/video/global_presence.flv", new VideoLoaderVars() .autoPlay(true) .alpha(1) .width(1280) .height(480) .name("global_presence_video") .onComplete(globalPresenceVideoComplete) .requireWithRoot(this.root) .scaleX(1.07) .scaleY(1.07) .volume(1) .x(-67) .y(111) ); globalPresenceVideo.load(); } private function globalPresenceVideoComplete(event:LoaderEvent):void { addChildAt(event.target.content, 1); event.target.content.loader.gotoVideoTime(0, true); } } }
  2. I adapted this code to fit inside a PureMVC framework that uses animated PNG sequences as interactive display objects. This code streamlined my production and added valuable timeline effects to playback. Thank you so much.
  3. Wow. Can't wait to try this code out. Thanks for clarifying my concern and echoing Carl's suggestion. I believe this is a useful technique for accomplishing a common task. In it's simplicity GS offers many diverse solutions.
  4. @Carl: Thanks for the link! Trying to avoid Flash IDE for animations so I can port to other platforms. I was hoping to stick solely with GS, but did not realize that this functionality was not built in. This would be a valuable feature—but there would have to be some kind of measurable playback fidelity similar to the Flash IDE timeline (or a video file). I considered an approach similar to viewtopic.php?f=1&t=4226, but it seemed like the playback performance would be adversely affected by rapid repositioning of graphics. The visibility property seems like it would take less CPU resource (maybe I am off the mark here). ---- Tried this method with reverse and didn't work. :/
  5. I want a timeline to display a series of frames in which each frame contains a single static bitmap image. My partially developed methodology sort of does what I want (see below). But it seems like this is not the most efficient way to accomplish my task. AS3 public function init(data:XMLList):void { this.data = data; for each (var action:XML in data.action) { for each (var sequence:XML in action.*) { var frameDuration:Number = 1 / sequence.length(); trace("frameDuration: " + frameDuration); for each(var frame:XML in sequence.*) { var sequenceFrame:ContentDisplay = LoaderMax.getContent(frame.@name); sequenceFrame.visible = false; addChild(sequenceFrame); var delay:int = (frame.childIndex() + 1) / sequence.length(); trace("delay: " + delay); sequenceTimeline.insert(new TweenMax(sequenceFrame, 1, {onStart:show, onStartParams:[sequenceFrame], onComplete:hide, onCompleteParams:[sequenceFrame]}), delay); function show(frameRef:ContentDisplay):void { trace("show"); frameRef.visible = true; } function hide(frameRef:ContentDisplay):void { trace("hide"); frameRef.visible = false; } } sequenceTimeline.gotoAndPlay(1); } } } XML <_01>
  6. I want to arrange a sequence of pngs which plays on a TimelineLite timeline. I have been struggling with this for hours. Are there any established methods for accomplishing this?
  7. Thanks for the swift reply... Here's some more information: Not using TLF. The SWF(s) work fine independently. A test SWF with simple button on stage also does not support interactivity when loaded with SWFLOader. Since I am unable to post the files here, I will post my configuration: data.xml ------------------------------------------------- loader proxy ------------------------------------------------- import com.greensock.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.*; import com.greensock.loading.display.*; LoaderMax.activate([imageLoader, XMLLoader, VideoLoader, SWFLoader, MP3Loader]); var data:XMLLoader = new XMLLoader("data.xml", {name:"data", onComplete:handleAssetsComplete}); data.load(); SWF View ------------------------------------------------- import com.greensock.*; import com.greensock.easing.*; import com.greensock.events.*; import com.greensock.loading.*; import com.greensock.loading.display.*; import com.greensock.loading.core.*; import com.greensock.loading.data.*; import com.greensock.plugins.*; var interactive:SWFLoader = LoaderMax.getLoader("asset1"); addChild(interactive.content); ****************** SWF appears to load fine, but there is no interactivity.
  8. After loading an SWF and placing on the stage, there is no interactivity inside that SWF. MouseEffects do not work. The external SWF and it's respective assets are all contained in the same folder system. The ScriptAccessDenied property of the SWFLoader is false. What is the problem?
×
×
  • Create New...