Comunidad de diseño web y desarrollo en internet online

Error 1010

Citar            
MensajeEscrito el 14 Feb 2012 02:50 pm
Soy nuevo y me gustaría aprender pero siguiendo un tuto que tengo este código me da error Error #1010: Un término no está definido y no tiene propiedades.
Es algo sencillo y no funciona, alguien me ayuda?
gracias de antemano
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;

public class Main extends MovieClip
{
var startPage:StartPage;
var hillPage:HillPage;
var pondPage:PondPage;

public function Main()
{
startPage= new StartPage();
pondPage= new PondPage();
hillPage= new HillPage();
addChild(startPage);


startPage.hillButton.addEventListener(MouseEvent.CLICK,onHillButtonClick);
startPage.pondButton.addEventListener(MouseEvent.CLICK,onPondButtonClick);

}

function onHillButtonClick(event:MouseEvent):void
{
addChild(hillPage);
removeChild(startPage);
}
function onPondButtonClick(event:MouseEvent):void
{
addChild(pondPage);
removeChild(startPage);
}
}

}

Por Faramyr

0 de clabLevel



 

firefox
Citar            
MensajeEscrito el 14 Feb 2012 09:49 pm
el error es un error en tiempo de ejecucion.

supongo que te da el error cuando haces new Main() ...los objetos de visualizacion "startPage.hillButton" o en "startPage.pondButton" no existe en "starPage"

cuando pongas un error de ejecucion tienes que poner el error completo por que te indica donde se produce el error por ejemplo:

TypeError: Error #1010: Un término no está definido y no tiene propiedades.
at codi::Energia_contador/sube_baja_energia()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()

bueno espero que te sirva y te haya aclarado la duda

saludos

Por Yonomimi

76 de clabLevel



Genero:Masculino  

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.