Jump to content
Search Community

Maggical

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by Maggical

  1. It's because you defined your duration as 1. That means it literally took one frame to complete the tween (since useFrames:true was in your vars object). My code indicated you should use a duration of 31, not 1.

     

    Thought those were seconds :S

  2. I added this:

     

    var myTween:TweenMax = new TweenMax(line_mc, 1, {frame:32, repeat:-1, useFrames:true});

     

    And the animation does not start, I tried adding this line:

     

    myTween.play();

     

    And also:

     

    myTween.resume();

     

    And nothing happens... Any ideas? From here I can start testing the other things...

  3. Hi there, I have an animated movieclip with 32 frames (animated using frame animation, not a tween), it loops as a normal movieclip according to the frameRate of the .fla

     

    I wanted to accelerate this movieclip's animation on rollOver and thought a tween would be a good idea, any recommended way to do it instead of a tween + onComplete callback to start over?

     

    Thanks,

     

    Javier

  4. Here's the class:

     

    package {
    ///
    import flash.display.Sprite;
    import flash.display.MovieClip;
    import flash.events.*;
    import flash.media.Sound;
    import flash.media.SoundChannel;  
    import flash.media.SoundTransform;
    import flash.media.SoundMixer;
    import flash.net.URLRequest;
    import flash.utils.Timer;
    import flash.utils.ByteArray; 
    ///
    // GreenScock TweenLite / TweenMax - Version: 11.1, Updated 10/21/2009
    ///
    import com.greensock.*; 
    import com.greensock.easing.*;
    import com.greensock.plugins.*; 
    ///
    public class music extends Sprite {
    	///
    	// VARIABLES
    	///
    	private var url:String;
    	private var boton:MovieClip;
    	private var song:SoundChannel;
    	private var soundFactory:Sound;
    	private var FourierTransform:Boolean = false;
    	private var arrayMixer:ByteArray = new ByteArray();
    	private var pan:int = 0;
    	private var porcentLoad:Number = 0; 
    	private var pausePoint:Number = 0.00;
    	private var isStarted:Boolean = true;
    
    	/*----------------------- INIT -----------------------*/
    	/*----------------------- INIT -----------------------*/
    	/*----------------------- INIT -----------------------*/
    	/*----------------------- INIT -----------------------*/
    	/*----------------------- INIT -----------------------*/
    	/*----------------------- INIT -----------------------*/
    
    	public function music():void {
    		///
    	}
    
    	/*----------------------- UTILS -----------------------*/
    	/*----------------------- UTILS -----------------------*/
    	/*----------------------- UTILS -----------------------*/
    	/*----------------------- UTILS -----------------------*/
    	/*----------------------- UTILS -----------------------*/
    	/*----------------------- UTILS -----------------------*/
    
    	public function cargarMusic(mp3:String, que_boton:MovieClip):void {
    		///
    		url = mp3;
    		boton = que_boton;
    		pausePoint = 0.00;
    		///
    		SoundMixer.stopAll();
    		soundFactory = new Sound();
    		var request:URLRequest = new URLRequest(url);
    		///
    		soundFactory.addEventListener(Event.COMPLETE, completeHandler);
    		soundFactory.addEventListener(ProgressEvent.PROGRESS, progressHandler);
    		soundFactory.load(request);
    	}
    
    	public function execMusic(e:MouseEvent):void {
    		///
    		if(isStarted){
    			///
    			TweenLite.to(song, 1, {volume:0, onComplete:pauseMusic});
    			///
    			isStarted = false;
    		}
    		else{
    			///
    			song = soundFactory.play(pausePoint);
    			song.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
    			///
    			TweenLite.to(song, 0, {volume:0});
    			TweenLite.to(song, 2, {volume:1});
    			///
    			isStarted = true;
    		}
    		///
    		MovieClip(boton.parent).clickMusicaHome();
    	}
    
    	public function playMusic():void {
    		///
    		song = soundFactory.play(pausePoint);
    		song.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
    		///
    		//TweenLite.to(song, 0, {volume:0});
    		//TweenLite.to(song, 5, {volume:1});
    	}
    
    	public function pauseMusic():void {
    		///
    		pausePoint = song.position;
    		song.stop();
    	}
    
    	public function loopMusic():void {
    		///
    		pausePoint = 0.00;
    		song = soundFactory.play(pausePoint);
    		song.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
    	}
    
    	private function soundCompleteHandler(e:Event):void {
    		///
    		song.removeEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
    		loopMusic();
    	}
    
    	public function get MixerMusic():ByteArray {
    		///
    		SoundMixer.computeSpectrum(arrayMixer, FourierTransform);
    		return arrayMixer;
    	}
    
    	public function set FourierMusic(valor:Boolean):void {
    		///
    		this.FourierTransform = valor;
    	}
    
    	public function get FourierMusic():Boolean {
    		///
    		return FourierTransform;
    	}
    
    	/*----------------------- LISTENERS -----------------------*/
    	/*----------------------- LISTENERS -----------------------*/
    	/*----------------------- LISTENERS -----------------------*/
    	/*----------------------- LISTENERS -----------------------*/
    	/*----------------------- LISTENERS -----------------------*/
    	/*----------------------- LISTENERS -----------------------*/
    
    	private function completeHandler(event:Event):void {
    		///
    		playMusic();
    		MovieClip(boton).lines_mc.play();
    	}
    
    	private function progressHandler(event:ProgressEvent):void {
    		///
    		porcentLoad = Math.round((event.bytesLoaded*100)/event.bytesTotal);
    	}
    }
    }

     

    In there if I remove the comments from the playMusic function tween volumes it gives me the error I mentioned... And the plug-in isn't active :S

     

    Weirddddddddddddddd...

     

    Usage like this:

     

    var music_home:music = new music();
    music_home.cargarMusic("music/music_site.mp3", music_mc);

     

    Hope it helps...

  5. Hi there, I have a class that I use to play music in as3. The thing is that I made a copy of that class and changed a few things to adapt it to a different movie clip, nothing in the core.

     

    But the TweeNLite is giving me an error... The error occurs in this line:

     

    song = soundFactory.play(pausePoint);
    song.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
    
    TweenLite.to(song, 0, {volume:0});
    TweenLite.to(song, 2, {volume:1});

     

    If I comment the Tween it doesn't output any errors... Any ideas of what's happenning? I'm using tweens like that in other functions in the same class and they work perfectly...

     

    Definitions are:

     

    private var song:SoundChannel;
    private var soundFactory:Sound;
    private var pausePoint:Number = 0.00;

     

    The error says (translated from spanish):

     

    ReferenceError: Error #1069: Porperty volume not found on flash.media.SoundChannel and there't no default value.

    at com.greensock::TweenLite/init()

    at com.greensock::TweenLite/renderTime()

    at com.greensock::TweenLite()

    at com.greensock::TweenLite$/to()

    at com.epika::epika_music/playMusic()

    at com.epika::epika_music/completeHandler()

     

    Thanks a lot,

     

    Javier

  6. Please post an example of it being broken. Also, you might want to look into the difference between ROLL_OVER/ROLL_OUT and MOUSE_OVER/MOUSE_OUT - it's a common mistake that can cause some headaches. This is probably a silly question, but you are using AS3, right?

     

    Yeah, I'm using AS3. I'll check that out to see how to make it work...

     

    Thanks,

     

    Javier

  7. Reviving this thread because I have a question about this...

     

    I've created my Tween like this:

     

    tooltip_clip.alpha = 0;

    var myTween:TweenMax = new TweenMax(tooltip_clip, 0.25, {alpha:1, ease:Linear.easeNone});

     

    Then I use:

     

    tooltip_clip.resume(); // And it plays correctly

     

    But when I use:

     

    tooltip_clip.reverse(); // It doesn't go to alpha 0

     

    Any ideas?

     

    Thanks,

     

    Javier

  8. Hi there, I'm Javier from Argentina and I'm starting out with AS3 and TweenLite/Max.

     

    I'm an advanced user of mc_tween for all of you that know it.

     

    I'm trying to achieve a simple matter here, and don't find the answer for this. Here's what I want to do...

     

    I have a MovieClip with 8 frames... I need the folowing functions:

     

    - One that starts/resumes those frames foward

    - One that starts/resumes those frames backward

    - One that pauses the current tween

     

    Any ideas how to acomplish this? I'm trying some things but there must be simpler ways to do this with TweenLite/Max...

     

    Thanks,

     

    Javier

×
×
  • Create New...