Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Naty

Classe Tween e motion_FINISH

Recommended Posts

Olá gente, este é o meu 1 post.... e queria um grande help...

Sou iniciante em AS3 e estou fazendo meu 1 site....

 

Vou postar o código.....

 

não estou conseguindo fazer a função funcionar.....

É um fundo e dps tem que aparecer o fundo do logo, dps o logo e dps começar as animações das bolinhas, porém não consigo fazer a função do fundo do logo chamar o logo e etc....

 

Vejam meu código....

 

//importar

import fl.transitions.Tween

import fl.transitions.easing.*

import fl.transitions.TweenEvent

 

// variaveis

var fundoRequest:URLRequest = new URLRequest("fundo_verde.jpg")

var fundoLoader:Loader = new Loader

 

var fundoLogoRequest:URLRequest = new URLRequest("fundo_logo.png")

var fundoLogoLoader:Loader = new Loader

 

var logoRequest:URLRequest = new URLRequest("logo.png")

 

//

 

var bolinha1:Bolinha1 = new Bolinha1()

var bolinha2:Bolinha2 = new Bolinha2()

var bolinha3:Bolinha3 = new Bolinha3()

var bolinha4:Bolinha4 = new Bolinha4()

var bolinhaGrande:BolinhaGrande = new BolinhaGrande()

var bolinha5:Bolinha5 = new Bolinha5()

var bolinhaGrande2:BolinhaGrande2 = new BolinhaGrande2()

var bolinha6:Bolinha6 = new Bolinha6()

var bolinha7:Bolinha7 = new Bolinha7()

 

 

var animaBolinha1:Tween

var animaBolinha2:Tween

var animaBolinha3:Tween

var animaGrande:Tween

var animaBolinha4:Tween

var animaGrande2:Tween

var animaBolinha5:Tween

var animaBolinha6:Tween

var animaBolinha7:Tween

 

 

fundoLogoLoader.addEventListener(Event.COMPLETE, showLogo)

 

function showLogo (e:Event) {

var logoLoader:Loader = new Loader

logoLoader.load(logoRequest)

//

addChildAt(logoLoader, 2)

logoLoader.x = 167

logoLoader.y = 173.9

 

 

}

animaBolinha1 = new Tween(bolinha1, "alpha", Elastic.easeOut, 0, 1, 1, true);

animaBolinha1.addEventListener(TweenEvent.MOTION_FINISH, vaiBolinha2)

 

function vaiBolinha2(evt:TweenEvent){

addChildAt(bolinha2, 3)

bolinha2.x = 218

bolinha2.y = 124.6

animaBolinha2 = new Tween(bolinha2, "alpha", Elastic.easeOut, 0, 1, 1, true);

animaBolinha2.addEventListener(TweenEvent.MOTION_FINISH, vaiBolinha3)

 

function vaiBolinha3(evt:TweenEvent){

addChildAt(bolinha3, 3)

bolinha3.x = 170

bolinha3.y = 134.3

animaBolinha3 = new Tween(bolinha3, "alpha", Elastic.easeOut, 0, 1, 1, true);

animaBolinha3.addEventListener(TweenEvent.MOTION_FINISH, vaiBolinha4)

 

function vaiBolinha4(evt:TweenEvent){

addChildAt(bolinha4, 3)

bolinha4.x = 142.3

bolinha4.y = 107.2

animaBolinha4 = new Tween(bolinha4, "alpha", Elastic.easeOut, 0, 1, 1, true);

animaBolinha4.addEventListener(TweenEvent.MOTION_FINISH, vaiBolinhaGrande)

 

function vaiBolinhaGrande(evt:TweenEvent){

addChildAt(bolinhaGrande, 3)

bolinhaGrande.x = 101.3

bolinhaGrande.y = 173

animaGrande = new Tween(bolinhaGrande, "alpha", Elastic.easeOut, 0, 1, 1, true);

animaGrande.addEventListener(TweenEvent.MOTION_FINISH, vaiBolinha5)

 

function vaiBolinha5(evt:TweenEvent){

addChildAt(bolinha5, 3)

bolinha5.x = 44.5

bolinha5.y = 221.1

animaBolinha5 = new Tween(bolinha5, "alpha", Elastic.easeOut, 0, 1, 1, true);

animaBolinha5.addEventListener(TweenEvent.MOTION_FINISH, vaiBolinhaGrande2)

 

function vaiBolinhaGrande2(evt:TweenEvent){

addChildAt(bolinhaGrande2, 3)

bolinhaGrande2.x = 93.5

bolinhaGrande2.y = 274.9

animaGrande2 = new Tween(bolinhaGrande2, "alpha", Elastic.easeOut, 0, 1, 1, true);

animaGrande2.addEventListener(TweenEvent.MOTION_FINISH, vaiBolinha6)

 

function vaiBolinha6(evt:TweenEvent){

addChildAt(bolinha6, 3)

bolinha6.x = 56.1

bolinha6.y = 329.4

animaBolinha6 = new Tween(bolinha6, "alpha", Elastic.easeOut, 0, 1, 1, true);

animaBolinha6.addEventListener(TweenEvent.MOTION_FINISH, vaiBolinha7)

 

function vaiBolinha7(evt:TweenEvent){

addChildAt(bolinha7, 3)

bolinha7.x = 80.5

bolinha7.y = 351.6

animaBolinha7 = new Tween(bolinha7, "alpha", Elastic.easeOut, 0, 1, 1, true);

 

}

}

}

}

}

}

}

}

 

//inicialização

addChildAt(fundoLoader, 0)

 

addChildAt(fundoLogoLoader, 1)

fundoLogoLoader.x = 73

fundoLogoLoader.y = 118.3

 

 

 

addChildAt(bolinha1, 3)

bolinha1.x = 193.2

bolinha1.y = 107.2

 

fundoLoader.load(fundoRequest)

fundoLogoLoader.load(fundoLogoRequest)

//

 

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

bom até agora eu já fiz alguns progressos....

agora só nao consigo startar....

//importar
import fl.transitions.Tween
import fl.transitions.easing.*
import fl.transitions.TweenEvent
import fl.transitions.*


// variaveis
var fundoRequest:URLRequest = new URLRequest("fundo_verde.jpg")
var fundoLoader:Loader = new Loader

var fundoLogoRequest:URLRequest = new URLRequest("fundo_logo.png")
var fundoLogoLoader:Loader = new Loader

var logoRequest:URLRequest = new URLRequest("logo.png")
var logoLoader:Loader = new Loader

//

var bolinha1:Bolinha1 = new Bolinha1()
var bolinha2:Bolinha2 = new Bolinha2()
var bolinha3:Bolinha3 = new Bolinha3()
var bolinha4:Bolinha4 = new Bolinha4()
var bolinhaGrande:BolinhaGrande = new BolinhaGrande()
var bolinha5:Bolinha5 = new Bolinha5()
var bolinhaGrande2:BolinhaGrande2 = new BolinhaGrande2()
var bolinha6:Bolinha6 = new Bolinha6()
var bolinha7:Bolinha7 = new Bolinha7()


var animaBolinha1:Tween
var animaBolinha2:Tween
var animaBolinha3:Tween
var animaGrande:Tween
var animaBolinha4:Tween
var animaGrande2:Tween
var animaBolinha5:Tween
var animaBolinha6:Tween
var animaBolinha7:Tween
//

var conteinerFundo:MovieClip = new MovieClip
var conteinerLogo:MovieClip = new MovieClip
//
//


var animaFundo:TransitionManager = new TransitionManager(conteinerFundo)

fundoLogoLoader.addEventListener(Event.COMPLETE, showFundo)

function showFundo (evt:Event) {
	animaFundo.startTransition
			({ type:Fly, direction:Transition.IN, duration:2, startPoint:2, easing:Bounce.easeOut})
			fundoLogoLoader.x = 73
			fundoLogoLoader.y = 118.3
			conteinerFundo.addChild(fundoLogoLoader)
			addChildAt(conteinerFundo, 1)
			
}

var animaLogo:TransitionManager = new TransitionManager(conteinerLogo)

logoLoader.addEventListener(Event.COMPLETE, showLogo)

function showLogo (evt:Event) {
	animaLogo.startTransition ({ type:Fade, direction:Transition.IN, duration:2  })
	logoLoader.x = 167
	logoLoader.y = 173.9
	conteinerLogo.addChild(logoLoader)
	addChildAt(conteinerLogo, 2)
	//
}

function vaiBolinha1 () {
	addChildAt(bolinha1, 3)
	bolinha1.x = 193.2
	bolinha1.y = 107.2
	animaBolinha1 = new Tween(bolinha1, "alpha", Elastic.easeOut, 0, 5, 0.1, true);
	animaBolinha1.addEventListener(TweenEvent.MOTION_FINISH, vaiBolinha2)
}

function vaiBolinha2(evt:TweenEvent){
	addChildAt(bolinha2, 3)
	bolinha2.x = 218
	bolinha2.y = 124.6
	animaBolinha2 = new Tween(bolinha2, "alpha", Elastic.easeOut, 0, 5, 0.3, true);
	animaBolinha2.addEventListener(TweenEvent.MOTION_FINISH, vaiBolinha3)
	
function vaiBolinha3(evt:TweenEvent){
	addChildAt(bolinha3, 3)
	bolinha3.x = 170
	bolinha3.y = 134.3
	animaBolinha3 = new Tween(bolinha3, "alpha", Elastic.easeOut, 0, 5, 0.5, true);
	animaBolinha3.addEventListener(TweenEvent.MOTION_FINISH, vaiBolinha4)
		
function vaiBolinha4(evt:TweenEvent){
	addChildAt(bolinha4, 3)
	bolinha4.x = 142.3
	bolinha4.y = 107.2
	animaBolinha4 = new Tween(bolinha4, "alpha", Elastic.easeOut, 0, 5, 0.1, true);
	animaBolinha4.addEventListener(TweenEvent.MOTION_FINISH, vaiBolinhaGrande)

function vaiBolinhaGrande(evt:TweenEvent){
	addChildAt(bolinhaGrande, 3)
	bolinhaGrande.x = 101.3
	bolinhaGrande.y = 173
	animaGrande = new Tween(bolinhaGrande, "alpha", Elastic.easeOut, 0, 5, 0.3, true);
	animaGrande.addEventListener(TweenEvent.MOTION_FINISH, vaiBolinha5)

function vaiBolinha5(evt:TweenEvent){
	addChildAt(bolinha5, 3)
	bolinha5.x = 44.5
	bolinha5.y = 221.1
	animaBolinha5 = new Tween(bolinha5, "alpha", Elastic.easeOut, 0, 5, 0.5, true);
	animaBolinha5.addEventListener(TweenEvent.MOTION_FINISH, vaiBolinhaGrande2)
				
function vaiBolinhaGrande2(evt:TweenEvent){
	addChildAt(bolinhaGrande2, 3)
	bolinhaGrande2.x = 93.5
	bolinhaGrande2.y = 274.9
	animaGrande2 = new Tween(bolinhaGrande2, "alpha", Elastic.easeOut, 0, 5, 0.8, true);
	animaGrande2.addEventListener(TweenEvent.MOTION_FINISH, vaiBolinha6)
				
function vaiBolinha6(evt:TweenEvent){
	addChildAt(bolinha6, 3)
	bolinha6.x = 56.1
	bolinha6.y = 329.4
	animaBolinha6 = new Tween(bolinha6, "alpha", Elastic.easeOut, 0, 5, 0.1, true);
	animaBolinha6.addEventListener(TweenEvent.MOTION_FINISH, vaiBolinha7)
	
function vaiBolinha7(evt:TweenEvent){
	addChildAt(bolinha7, 3)
	bolinha7.x = 80.5
	bolinha7.y = 351.6
	animaBolinha7 = new Tween(bolinha7, "alpha", Elastic.easeOut, 0, 5, 0.3, true);
		
}
}
}
}
}							
}
}
}

//inicialização
addChildAt(fundoLoader, 0)

//
fundoLoader.load(fundoRequest)
fundoLogoLoader.load(fundoLogoRequest)
logoLoader.load(logoRequest)
//

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.