Jump to content
Search Community

crusy

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by crusy

  1. you're the man, that was the trick.

     

    for the record:

     

    _loader = new SWFLoader( 'video_chaptera.swf', { auditSize:false, autoPlay:false, onProgress:_onLoaderProgress } );
    _loader.load();
    
    private function _onLoaderProgress(event : Event) : void
    {
    trace( 'loaded: ' + _loader.progress );
    
    if( _loader.rawContent )
    {
    	// do not address it twice, for garbage collection:
    	if ( _loadedSWF == null && _loader.progress >= MIN_PERCENTAGE_LOADED )
    	{
    		_loadedSWF = _loader.rawContent as MovieClip;
    
    		// maybe it was no MovieClip?
    		if( _loadedSWF )
    		{
    			// the volume was set to 0 by {autoPlay:false}
    			var st:SoundTransform = _loadedSWF.soundTransform;
    			st.volume = 1;
    			_loadedSWF.soundTransform = st;
    
    			addChild( _loadedSWF );
    			_loadedSWF.gotoAndPlay( 1 );
    		}
    	}
    }
    }
    

     

    The out-of-sync-problem: The sound was in a MC on the main timeline. So either you do an _loadedSWF['mySound'].gotoAndPlay(1) together with the _loadedSWF.gotoAndPlay( 1 ); from above - or you put the sound on the main timeline

     

    Thanks a lot!

  2. Hmmm, maybe the error was just the "autoPlay:false" (which is a relict from a previous version where I wanted to preload the SWF before showing the view)

     

    I changed the relevant part to:

     

    _loader = new SWFLoader( 'video_chaptera.swf', { auditSize:false, onProgress:_onLoaderProgress } );
    _loader.load();
    
    private function _onLoaderProgress(event : Event) : void
    {
    if ( _loadedSWF == null && _loader.progress >= MIN_PERCENTAGE_LOADED )
    {
    	_loadedSWF = _loader.rawContent as MovieClip;
    
    	if( _loadedSWF )
    	{
    		addChild(_loadedSWF);
    	}
    }
    }
    

     

    and it seems to work... I am still careful to say this :-)

     

    What I still don't understand: As the video within the SWF is NOT encapsulated in a separate MC or something, but is on the same timeline as the sound (frame #100 of the SWF is frame #100 of the sound and frame #100 of the video as well!), and as the sound is playing - why is the video not playing (frame #100 of the SWF and the sound, but still frame #1 of the video)?

  3. Hi,

     

    I have an swf containing a video and a separate sound lying on the timeline. I want to load it with SWFLoader and play it before the loading has finished. This works on my MacBook (Firefox 4.0.1, FP 10.2.x) at home, but neither on my Mac here at work nor on a Windows XP (IE 6, FP 10.2.159.1): The first frame of the video appears and I hear the sound playing, but the video is not playing... you can find a basic example here:

     

    http://lennart.next.jvm.de/download/as3 ... r_test.zip

    (the file is about 19 MB because of the SWF)

     

    Any idea?

     

    The fact that I can access both the video and the sound (instance name video_1 and sound_1) tells me the SWF is ready for access. The fact the sound is playing tells me the SWF is/gets loaded and plays. The video is on the same frames as the sound, but it's not playing!

     

    TIA,

    crusy

×
×
  • Create New...