Jump to content
Search Community

burvs

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by burvs

  1. Hi Carl, Aha that would make a great deal of sense. It does cut off at around 32 I think. I did discover today that if I first preload all my videos using Videoloader, and then once they are loaded, loop through them and call close() on each netStream, I can then call load on them again when they are required, and because they are cached they will then play instantly with the audio intact. So yes, too many concurrent sound channels makes sense. I had thought that perhaps there were some kind of upper limit on netstreams. In my case I've decided not to preload my videos at all. I can live with the tiny buffering delay I get when trying to load them. It's barely noticeable.
  2. This is a strange one, and I'm running out of ideas for a solution. I've got 67 small flvs (between 60k - 150k each) and I'm trying to preload them all in one go so that I can then play them instantly as required. The below appears to work absolutely fine, correctly loading them all, and cycling through playing each one on the click of a button. EXCEPT that the very first one, and all of the ones above about number 30, are not playing their audio. I know the audio is correctly in place on all the latter videos, as if I reduce the number of videos and just load the latter bunch, the audio works fine. Equally if I only load the first 30, then the audio of the very first one plays fine. I've tried splitting the loading into two different queues, each with it's own LoaderMax instance, and loading one queue after the other has finished, but the same thing happens. It's as if there is some maximum number of NetStreams Flash can handle before the audio starts screwing up on some of them. Am I expecting too much to want to preload so many flvs (even though they are all pretty small)? Any ideas of what I could try next? Or any other approaches to my problem that might work? Many thanks! package { import com.greensock.events.LoaderEvent; import com.greensock.loading.LoaderMax; import com.greensock.loading.VideoLoader; import flash.display.Sprite; import flash.events.MouseEvent; import flash.media.SoundTransform; import flash.media.Video; import flash.net.NetConnection; import flash.net.NetStream; [sWF(backgroundColor = "#999999", frameRate = "40", width = "400", height = "300")] public class VidTest extends Sprite { private var _button : Sprite; private var _vidHolder : Sprite; private var _currentVid : int = 1; private var _myVidLoader : VideoLoader; private var _queue : LoaderMax; public function VidTest() { drawButton(); _vidHolder = new Sprite(); addChild(_vidHolder); _vidHolder.x = 50; _vidHolder.y = 50; _queue = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); for (var i : int = 1; i <= 67; i++) { _queue.append(new VideoLoader("vid" + i + ".flv", {name:"vid" + i, autoPlay:false, volume:1})); } // start loading the LoaderMax queue _queue.load(); } private function completeHandler(event : LoaderEvent) : void { trace('completeHandler: '); addChild(_button); _currentVid = 1; onClickButton(null); } private function onClickButton(event : MouseEvent) : void { trace('onClickButton: ' + (onClickButton)); if (_myVidLoader) _myVidLoader.pauseVideo(); _myVidLoader = LoaderMax.getLoader("vid" + _currentVid); trace('_currentVid: ' + (_currentVid)); while (_vidHolder.numChildren) { _vidHolder.removeChildAt(0); } _vidHolder.addChild(_myVidLoader.content); _myVidLoader.volume = 1; _myVidLoader.gotoVideoTime(0); _myVidLoader.playVideo(); if (_currentVid < 67) { _currentVid++; } else { _currentVid = 1; } } private function progressHandler(event : LoaderEvent) : void { trace("progress: " + event.target.progress); } private function errorHandler(event : LoaderEvent) : void { trace("error occured with " + event.target + ": " + event.text); } private function drawButton() : void { _button = new Sprite(); _button.graphics.beginFill(0xff9900); _button.graphics.drawCircle(0, 0, 50); _button.addEventListener(MouseEvent.CLICK, onClickButton); _button.x = 10; _button.y = 10; } } }
  3. Thanks for clearing that up guys!
  4. Something I used to do now and again was tween a null object specifically for the purpose of calling a function after a delay like this: TweenMax.to(null, 3, {onComplete:doStuff}); .. which was just a handy way of making "doStuff" happen after 3 seconds. I'm sure it was Jack himself that actually suggested this as a valid way of working (albeit some time ago now). I've noticed that with the latest update, this has stopped working and now throws an error that you can't tween a null object. Is there a way around this, or some other equally handy way of achieving the same thing? Thanks!
×
×
  • Create New...