Comunidad de diseño web y desarrollo en internet online

sitio web dinamico que se adapta al browser.

Citar            
MensajeEscrito el 03 Abr 2010 04:01 pm
Amigos, tengo un sitio en flash as3 dinamico que se adapta a la ventana del explorador. Funciomna super bien. El problema comienza cuando intento agregarle un precargador externo, me aparece el siguente error.

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Website()


He intentado varias maneras pero me esta costando modificar el codigo. Aca lo envio.

package {

import flash.display.*;
import FluidLayout.*;

public class Website extends MovieClip{

public function Website()
{

if(stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
private function init(event:Event = null):void {
removeEventListener(Event.ADDED_TO_STAGE, init);
}

/* Set the Scale Mode of the Stage */
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;

/* Add the symbols to stage */
var bg = new Background();
addChild(bg);

var title = new Title();
addChild(title);

var menu = new Menu();
addChild(menu);

var middle = new Middle();
addChild(middle);

var footer = new Footer();
addChild(footer);

/* Apply the alignment to the background */
var bgParam = {
x:0,
y:0,
offsetX: 0,
offsetY: 0
}


new FluidObject(bg,bgParam);

/* Apply the alignment to the title */
var titleParam = {
x:0,
y:0,
offsetX:0,
offsetY:0
}
new FluidObject(title,titleParam);

/* Apply simple alignment to the title */
/*var titleParam = {
alignment: "TOP_LEFT",
margin: 0
}
new SimpleFluidObject(title,titleParam);*/

/* Apply the alignment to the menu */
var menuParam = {
x:1,
y:0,
offsetX: -menu.width - 20,
offsetY: 20
}
new FluidObject(menu,menuParam);

/* Apply the alignment to the content */
var middleParam = {
x:0.5,
y:0.5,
offsetX: -middle.width/2,
offsetY: -middle.height/2
}
new FluidObject(middle,middleParam);

/* Apply the alignment to the footer */
var footerParam = {
x:1,
y:1,
offsetX: -footer.width - 10,
offsetY: -footer.height -10
}
new FluidObject(footer,footerParam);
}
}
}


Alguien me puede ayudar? Gracias!!!

Por telefunken

0 de clabLevel



 

firefox
Citar            
MensajeEscrito el 04 Abr 2010 10:57 am
hola telefunken ,ese error significa que en algun objeto declarado no se puede acceder a sus propiedades porque este este "Vacio "o nulo ,

puede ser por no importar la clase o podria ser que no este bien declarado( a mi me dio siempre error por la primera ).

a simple vista pareciera que has declarado mal las variables y objetos .
estas obligado a declara de que tipo son EJ

Código ActionScript :

var numero:Number =0;

o en tu caso un objetodeclarado asi EJ.

Código ActionScript :

var bg:Backgrouond=new Background(); 

te recomiendo que busques algun tutorial de programacion orientada a objetos .ya que si Background es un a classe tambien habrias de importarla.
estas trabajando con FlashDevelop?

Por maximil13

70 de clabLevel



Genero:Masculino  

Programador, estudiante de sistemas.

firefox

 

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