Jump to content
Search Community

seddass

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by seddass

  1. [sOLVED]

     

    IMPORTANT: When using GS with require.js dont override the GS variables like that:

    define(['ScrollToPlugin', 'TweenLite', 'TimelineLite'], 
    function(ScrollToPlugin, TweenLite, TimelineLite) {
       // your code here
    })
    

    Hello, 

    I am doing something weird probably because I cant add Tween to Timeline.

    var tw = TweenLite.to(window, 0.7, {scrollTo:{y: 300}, ease:Power3.easeInOut});
    console.log(tw);
    var tl = new TimelineLite();
    tl.add( tw );

    and the same when testing this way:

    var tl = new TimelineLite();
    tl.add( TweenLite.to(window, 0.7, {scrollTo:{y: 300}, ease:Power3.easeInOut}) );

    Both ways I see the error:

     

    Uncaught Cannot add [object Object] into the timeline; it is not a tween, timeline, function, or string.

     

    The output from console.log(tw) begins with:

     

    Object {varsObject_totalDuration0.7_duration0.7_delay:0_timeScale1}

    1. _activefalse
    2. _delay0
    3. _duration0.7
    4. _easeObject
    5. _easePower3
    6. _easeType3
    7. _firstPTObject
    8.  

     

    It looks like a tween anyway.. What I am doing wrong? 

    Same code in jsFiddle is working fine. Pls. help with a hint. 

     

    EDIT: I am loading all .js files with require.js (AMD loader). What is the correct way of loading GS plugins with require.js shim?

  2. Hello guys,

    I have searched a lot in the forum and I have spend hours but I still cant find the answer.

     

    The question is..

    How to remove/kill/unload/dispose/erase VideoLoader when the video is buffering?

     

    My problem is when I load a video in VideoLoader and while the video is still buffering and i call video unload() and/or dispose(true) the sound of the video start playing after all. Below is my code I am using. If I call disposeVideo() WHILE the video is buffering.. the sound of the video starts to play in a background after the video is buffered. Probably it is not only the sound that is played. :)

    Hope for help.

    Thanks.

     

    function loadVideo():void {
       var videoConfig : Object = {name:"HomeVideo", width:506, height:285, scaleMode:"stretch", bgColor:0x000000, autoPlay:false, volume:0};
       _video = new VideoLoader("myVideo.flv", videoConfig);
       _video.load();
       _video.gotoVideoTime(0, true);
       ...
       added some listeners...
    }
    
    function disposeVideo() : void {
    if (_video.videoPaused) reinitPlayPause();
    TweenMax.to(preloader_mc, 0.2, {autoAlpha:0, onComplete:preloader_mc.stop});
    TweenMax.to(_video.content, 0.2, {autoAlpha:0});
    _video.removeEventListener(VideoLoader.VIDEO_BUFFER_FULL, bufferFullHandler);
    _video.removeEventListener(NetStatusEvent.NET_STATUS, onNetStatusChange);			
    videoContainer_mc.removeChild(_video.content);
    TweenMax.to(_video, 0.2, {volume:0, onComplete: function():void {
    	_video.pauseVideo();
    	_video.unload();
    	_video.dispose(true);
    }});
    }
    

×
×
  • Create New...