Προς το περιεχόμενο

Προβλημα με SwfAddress


vandimen

Προτεινόμενες αναρτήσεις

Δημοσ.

Γεια σας,

Εχω ενα Προβλημα με το SwfAddress ενω τα κανω ολα σωστα μου βγαιζει το εξης:

 

TypeError: Error #2007: Parameter child must be non-null.

at flash.display::DisplayObjectContainer/removeChild()

at LonisTattooFinalSwf_fla::MainTimeline/frame1()

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

at LonisTattooFinalSwf_fla::MainTimeline/contact()

at LonisTattooFinalSwf_fla::MainTimeline/onChange()

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at com.asual.swfaddress::SWFAddress$/_dispatchEvent()

at com.asual.swfaddress::SWFAddress$/_setValueInit()

at com.asual.swfaddress::SWFAddress$/_check()

at flash.utils::Timer/_timerDispatch()

at flash.utils::Timer/tick()

 

Μηπως μπορειετε σας παρακαλω να με βοηθειτε τι φταιει??

 

Ευχαριστω

Δημοσ.
Γεια σας,

Εχω ενα Προβλημα με το SwfAddress ενω τα κανω ολα σωστα μου βγαιζει το εξης:

 

TypeError: Error #2007: Parameter child must be non-null.

at flash.display::DisplayObjectContainer/removeChild()

at LonisTattooFinalSwf_fla::MainTimeline/frame1()

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

at LonisTattooFinalSwf_fla::MainTimeline/contact()

at LonisTattooFinalSwf_fla::MainTimeline/onChange()

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at com.asual.swfaddress::SWFAddress$/_dispatchEvent()

at com.asual.swfaddress::SWFAddress$/_setValueInit()

at com.asual.swfaddress::SWFAddress$/_check()

at flash.utils::Timer/_timerDispatch()

at flash.utils::Timer/tick()

 

Μηπως μπορειετε σας παρακαλω να με βοηθειτε τι φταιει??

 

Ευχαριστω

 

Παρακαλω αν γνωριζει ή εχει καμια ιδεα καποιος να μου τι μπορει να φταιει.

Ευχαριστω

Δημοσ.

Αν δεν μας δείξεις και τον κώδικα, δεν είναι εύκολο να σου πούμε τι φταίει. Το προφανές πάντως είναι ότι προσπαθείς να κάνεις remove ένα child χωρίς να υπάρχει.

Δημοσ.
Αν δεν μας δείξεις και τον κώδικα, δεν είναι εύκολο να σου πούμε τι φταίει. Το προφανές πάντως είναι ότι προσπαθείς να κάνεις remove ένα child χωρίς να υπάρχει.

Επισης μου παρουσιαζει και αυτο το μηνυμα...

 

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

at LonisTattooSwfAddress2_fla::MainTimeline/photosClick()

at LonisTattooSwfAddress2_fla::MainTimeline/onChange()

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at com.asual.swfaddress::SWFAddress$/_dispatchEvent()

at com.asual.swfaddress::SWFAddress$/_setValueInit()

at com.asual.swfaddress::SWFAddress$/_check()

at flash.utils::Timer/_timerDispatch()

at flash.utils::Timer/tick()

 

---------- Προσθήκη στις 20:35 ---------- Προηγούμενο μήνυμα στις 20:32 ----------

 

Ο κωδικας Ειναι Ο παρακατω...Θα με Βοηθουσατε πολυ αν μου δινατε καποια λυση...

 

import fl.transitions.Tween;

import fl.transitions.easing.*;

import flash.geom.ColorTransform;

import com.asual.swfaddress.*;

 

SWFAddress.addEventListener(SWFAddressEvent.CHANGE, onChange);

 

function onChange(e:SWFAddressEvent):void

{

if(e.value != "/")

SWFAddress.setTitle("Bea Brimelow - " + e.value.substring(1));

else

SWFAddress.setTitle("LonisTattoo - Biography");

 

switch(e.value)

{

case "/TattooGallery":

photosClick(null);

break;

 

case "/Biography":

bioClick(null);

break;

 

case "/Videos":

videosClick(null);

break;

 

case "/MapView":

mapviewClick(null);

break;

 

case "/Contact":

contactClick(null);

break;

 

case "/":

photosClick(null);

break;

}

}

var currentPage:MovieClip=gallery_btn;

 

var outPage: pageOut=new pageOut();

outPage.stop();

 

var tattooPage: pageGallery=new pageGallery();

 

var contactPage: pageContact=new pageContact();

contactPage.stop();

 

var biografyPage: pageBiografy=new pageBiografy();

biografyPage.stop();

 

var mapPage: pageMap=new pageMap();

mapPage.stop();

 

 

var videosPage: pageVideos=new pageVideos();

videosPage.stop();

 

 

tattooPage.x=432;

tattooPage.y=337;

 

addChild(tattooPage);

tattooPage.gotoAndPlay(25);

 

outPage.x=biografyPage.x=videosPage.x=contactPage.x=mapPage.x=432;

outPage.y=biografyPage.y=videosPage.y=contactPage.y=mapPage.y=337;

 

 

biografy_btn.buttonMode = true;

biografy_btn.addEventListener(MouseEvent.ROLL_OVER, buttonOver);

biografy_btn.addEventListener(MouseEvent.ROLL_OUT, buttonOut);

 

videos_btn.buttonMode = true;

videos_btn.addEventListener(MouseEvent.ROLL_OVER, buttonOver);

videos_btn.addEventListener(MouseEvent.ROLL_OUT, buttonOut);

 

gallery_btn.buttonMode = true;

gallery_btn.addEventListener(MouseEvent.ROLL_OVER,buttonOver);

gallery_btn.addEventListener(MouseEvent.ROLL_OUT, buttonOut);

 

map_btn.buttonMode = true;

map_btn.addEventListener(MouseEvent.ROLL_OVER,buttonOver);

map_btn.addEventListener(MouseEvent.ROLL_OUT, buttonOut);

 

contact_btn.buttonMode = true;

contact_btn.addEventListener(MouseEvent.ROLL_OVER, buttonOver);

contact_btn.addEventListener(MouseEvent.ROLL_OUT, buttonOut);

 

 

biografy_btn.addEventListener(MouseEvent.CLICK, bioClick);

videos_btn.addEventListener(MouseEvent.CLICK, photosClick);

gallery_btn.addEventListener(MouseEvent.CLICK,videosClick);

map_btn.addEventListener(MouseEvent.CLICK, mapviewClick);

contact_btn.addEventListener(MouseEvent.CLICK, contactClick);

 

 

biografy_btn.TargetMC=biografyPage;

videos_btn.TargetMC=videosPage;

gallery_btn.TargetMC=tattooPage;

map_btn.TargetMC=mapPage;

contact_btn.TargetMC=contactPage;

 

function bioClick(e:MouseEvent):void

{

 

removeChild(currentPage.TargetMC);

//tattooPage.shopPage.visible=false;

//tattooPage.artPage.visible=false;

//tattooPage.tattooPage2.visible=false;

 

if(e.target == biografy_btn){

SWFAddress.setValue("Biography");

addChild(outPage);

outPage.gotoAndPlay(2);

}

currentPage=MovieClip(e.currentTarget);

addChild(currentPage.TargetMC);

currentPage.TargetMC.gotoAndPlay(2);

 

}

function photosClick(e:MouseEvent):void

{

removeChild(currentPage.TargetMC);

if(e.target == gallery_btn){

SWFAddress.setValue("TattooGallery");

addChild(outPage);

outPage.gotoAndPlay(2);

}

currentPage=MovieClip(e.currentTarget);

addChild(currentPage.TargetMC);

currentPage.TargetMC.gotoAndPlay(2);

 

}

function videosClick(e:MouseEvent):void

{

removeChild(currentPage.TargetMC);

if(e.target == videos_btn){

music_mc.gotoAndStop("music off");

SWFAddress.setValue("Videos");

butterFly.alpha=.5;

addChild(outPage);

outPage.gotoAndPlay(2);

}

currentPage=MovieClip(e.currentTarget);

addChild(currentPage.TargetMC);

currentPage.TargetMC.gotoAndPlay(2);

 

}

function mapviewClick(e:MouseEvent):void

{

removeChild(currentPage.TargetMC);

if(e.target == map_btn){

SWFAddress.setValue("MapView");

butterFly.alpha=.5;

if(currentPage == videos_btn)

{

videosPage.lonisvideo.stop();

}

addChild(outPage);

outPage.gotoAndPlay(2);

}

currentPage=MovieClip(e.currentTarget);

addChild(currentPage.TargetMC);

currentPage.TargetMC.gotoAndPlay(2);

 

}

function contactClick(e:MouseEvent):void

{

removeChild(currentPage.TargetMC);

if(e.target == contact_btn){

SWFAddress.setValue("Contact");

butterFly.alpha=.5;

addChild(outPage);

outPage.gotoAndPlay(2);

}

currentPage=MovieClip(e.currentTarget);

addChild(currentPage.TargetMC);

currentPage.TargetMC.gotoAndPlay(2);

}

Δημοσ.

Με μια πρώτη ανάγνωση, πιθανολογώ ότι το λάθος προκύπτει στο event SWFAddressEvent.CHANGE και οχι σε καποιο mouse click.

Αν προσέξεις το switch στο function εκείνο καλεί μια σειρά άλλων functions (που κανονικά καλούνται από mouse clicks) με mouse event simulation (null).

Το λάθος στο μήνυμα που έστειλες προκύπτει από την μέθοδο photosClick η οποία το πρώτο που κάνει είναι removeChild(currentPage.TargetMC) το οποίο μάλλον δεν υπάρχει στο stage εκείνη τη στιγμή.

Κάνε σχόλιο τον listener στην πρώτη γραμμή του κώδικα και δες αν αλλάζει κάτι και αν όντως προς τα εκεί είναι η λύση, πρόσθεσε έναν έλεγχο του αν υπάρχει το target, πριν κάνεις removeChild.

 

 

Επισης μου παρουσιαζει και αυτο το μηνυμα...

 

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

at LonisTattooSwfAddress2_fla::MainTimeline/photosClick()

at LonisTattooSwfAddress2_fla::MainTimeline/onChange()

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at com.asual.swfaddress::SWFAddress$/_dispatchEvent()

at com.asual.swfaddress::SWFAddress$/_setValueInit()

at com.asual.swfaddress::SWFAddress$/_check()

at flash.utils::Timer/_timerDispatch()

at flash.utils::Timer/tick()

 

---------- Προσθήκη στις 20:35 ---------- Προηγούμενο μήνυμα στις 20:32 ----------

 

Ο κωδικας Ειναι Ο παρακατω...Θα με Βοηθουσατε πολυ αν μου δινατε καποια λυση...

 

import fl.transitions.Tween;

import fl.transitions.easing.*;

import flash.geom.ColorTransform;

import com.asual.swfaddress.*;

 

SWFAddress.addEventListener(SWFAddressEvent.CHANGE, onChange);

 

function onChange(e:SWFAddressEvent):void

{

if(e.value != "/")

SWFAddress.setTitle("Bea Brimelow - " + e.value.substring(1));

else

SWFAddress.setTitle("LonisTattoo - Biography");

 

switch(e.value)

{

case "/TattooGallery":

photosClick(null);

break;

 

case "/Biography":

bioClick(null);

break;

 

case "/Videos":

videosClick(null);

break;

 

case "/MapView":

mapviewClick(null);

break;

 

case "/Contact":

contactClick(null);

break;

 

case "/":

photosClick(null);

break;

}

}

var currentPage:MovieClip=gallery_btn;

 

var outPage: pageOut=new pageOut();

outPage.stop();

 

var tattooPage: pageGallery=new pageGallery();

 

var contactPage: pageContact=new pageContact();

contactPage.stop();

 

var biografyPage: pageBiografy=new pageBiografy();

biografyPage.stop();

 

var mapPage: pageMap=new pageMap();

mapPage.stop();

 

 

var videosPage: pageVideos=new pageVideos();

videosPage.stop();

 

 

tattooPage.x=432;

tattooPage.y=337;

 

addChild(tattooPage);

tattooPage.gotoAndPlay(25);

 

outPage.x=biografyPage.x=videosPage.x=contactPage.x=mapPage.x=432;

outPage.y=biografyPage.y=videosPage.y=contactPage.y=mapPage.y=337;

 

 

biografy_btn.buttonMode = true;

biografy_btn.addEventListener(MouseEvent.ROLL_OVER, buttonOver);

biografy_btn.addEventListener(MouseEvent.ROLL_OUT, buttonOut);

 

videos_btn.buttonMode = true;

videos_btn.addEventListener(MouseEvent.ROLL_OVER, buttonOver);

videos_btn.addEventListener(MouseEvent.ROLL_OUT, buttonOut);

 

gallery_btn.buttonMode = true;

gallery_btn.addEventListener(MouseEvent.ROLL_OVER,buttonOver);

gallery_btn.addEventListener(MouseEvent.ROLL_OUT, buttonOut);

 

map_btn.buttonMode = true;

map_btn.addEventListener(MouseEvent.ROLL_OVER,buttonOver);

map_btn.addEventListener(MouseEvent.ROLL_OUT, buttonOut);

 

contact_btn.buttonMode = true;

contact_btn.addEventListener(MouseEvent.ROLL_OVER, buttonOver);

contact_btn.addEventListener(MouseEvent.ROLL_OUT, buttonOut);

 

 

biografy_btn.addEventListener(MouseEvent.CLICK, bioClick);

videos_btn.addEventListener(MouseEvent.CLICK, photosClick);

gallery_btn.addEventListener(MouseEvent.CLICK,videosClick);

map_btn.addEventListener(MouseEvent.CLICK, mapviewClick);

contact_btn.addEventListener(MouseEvent.CLICK, contactClick);

 

 

biografy_btn.TargetMC=biografyPage;

videos_btn.TargetMC=videosPage;

gallery_btn.TargetMC=tattooPage;

map_btn.TargetMC=mapPage;

contact_btn.TargetMC=contactPage;

 

function bioClick(e:MouseEvent):void

{

 

removeChild(currentPage.TargetMC);

//tattooPage.shopPage.visible=false;

//tattooPage.artPage.visible=false;

//tattooPage.tattooPage2.visible=false;

 

if(e.target == biografy_btn){

SWFAddress.setValue("Biography");

addChild(outPage);

outPage.gotoAndPlay(2);

}

currentPage=MovieClip(e.currentTarget);

addChild(currentPage.TargetMC);

currentPage.TargetMC.gotoAndPlay(2);

 

}

function photosClick(e:MouseEvent):void

{

removeChild(currentPage.TargetMC);

if(e.target == gallery_btn){

SWFAddress.setValue("TattooGallery");

addChild(outPage);

outPage.gotoAndPlay(2);

}

currentPage=MovieClip(e.currentTarget);

addChild(currentPage.TargetMC);

currentPage.TargetMC.gotoAndPlay(2);

 

}

function videosClick(e:MouseEvent):void

{

removeChild(currentPage.TargetMC);

if(e.target == videos_btn){

music_mc.gotoAndStop("music off");

SWFAddress.setValue("Videos");

butterFly.alpha=.5;

addChild(outPage);

outPage.gotoAndPlay(2);

}

currentPage=MovieClip(e.currentTarget);

addChild(currentPage.TargetMC);

currentPage.TargetMC.gotoAndPlay(2);

 

}

function mapviewClick(e:MouseEvent):void

{

removeChild(currentPage.TargetMC);

if(e.target == map_btn){

SWFAddress.setValue("MapView");

butterFly.alpha=.5;

if(currentPage == videos_btn)

{

videosPage.lonisvideo.stop();

}

addChild(outPage);

outPage.gotoAndPlay(2);

}

currentPage=MovieClip(e.currentTarget);

addChild(currentPage.TargetMC);

currentPage.TargetMC.gotoAndPlay(2);

 

}

function contactClick(e:MouseEvent):void

{

removeChild(currentPage.TargetMC);

if(e.target == contact_btn){

SWFAddress.setValue("Contact");

butterFly.alpha=.5;

addChild(outPage);

outPage.gotoAndPlay(2);

}

currentPage=MovieClip(e.currentTarget);

addChild(currentPage.TargetMC);

currentPage.TargetMC.gotoAndPlay(2);

}

Δημοσ.

djpaul1963 αν βαλω σχολια στο Listener του swfaddress λογικα δεν θα λειτουργει το deep linking,ετσι δεν ειναι??βεΒαια το δοκιμασα και δεν επαιξε...αν και την αρχικη που εχω ορισει να εμφανιζει το flashaki την εμφανιζει κανονικα πλεον χωρις να υπαρχει προβλημα,αλλα οταν παταω καποιο κουμπι για να τρεξει μια οποιαδηποτε αλλη συναρτηση δεν εμφανιζεσαι καμια!Σου χανα στελνω λιγο τον κωδικα τροποποιημενογια ειχα καποια λαθη ...αν μπορεις σε παρακαλω γρα πως το εννοεις!Σε Ευχαριστω και παλι!

 

import fl.transitions.Tween;

import fl.transitions.easing.*;

import flash.geom.ColorTransform;

import com.asual.swfaddress.*;

 

 

 

//SWFAddress.addEventListener(SWFAddressEvent.CHANGE, onChange);

 

function onChange(e:SWFAddressEvent):void

{

if(e.value != "/")

SWFAddress.setTitle("LonisTattoo - " + e.value.substring(1));

else

SWFAddress.setTitle("LonisTattoo - Biography");

 

switch(e.value)

{

case "/TattooGallery":

photosClick(null);

break;

 

case "/Biography":

bioClick(null);

break;

 

case "/Videos":

videosClick(null);

break;

 

case "/MapView":

mapviewClick(null);

break;

 

case "/Contact":

contactClick(null);

break;

 

case "/":

photosClick(null);

break;

}

}

var currentPage:MovieClip=gallery_btn;

 

var tattooPage: pageGallery=new pageGallery();

 

var outPage: pageOut=new pageOut();

outPage.stop();

 

var contactPage: pageContact=new pageContact();

contactPage.stop();

 

var biografyPage: pageBiografy=new pageBiografy();

biografyPage.stop();

 

var mapPage: pageMap=new pageMap();

mapPage.stop();

 

 

var videosPage: pageVideos=new pageVideos();

videosPage.stop();

 

 

tattooPage.x=432;

tattooPage.y=337;

 

addChild(tattooPage);

tattooPage.gotoAndPlay(25);

 

outPage.x=biografyPage.x=videosPage.x=contactPage.x=mapPage.x=432;

outPage.y=biografyPage.y=videosPage.y=contactPage.y=mapPage.y=337;

 

 

biografy_btn.buttonMode = true;

biografy_btn.addEventListener(MouseEvent.ROLL_OVER, buttonOver);

biografy_btn.addEventListener(MouseEvent.ROLL_OUT, buttonOut);

 

videos_btn.buttonMode = true;

videos_btn.addEventListener(MouseEvent.ROLL_OVER, buttonOver);

videos_btn.addEventListener(MouseEvent.ROLL_OUT, buttonOut);

 

gallery_btn.buttonMode = true;

gallery_btn.addEventListener(MouseEvent.ROLL_OVER,buttonOver);

gallery_btn.addEventListener(MouseEvent.ROLL_OUT, buttonOut);

 

map_btn.buttonMode = true;

map_btn.addEventListener(MouseEvent.ROLL_OVER,buttonOver);

map_btn.addEventListener(MouseEvent.ROLL_OUT, buttonOut);

 

contact_btn.buttonMode = true;

contact_btn.addEventListener(MouseEvent.ROLL_OVER, buttonOver);

contact_btn.addEventListener(MouseEvent.ROLL_OUT, buttonOut);

 

 

biografy_btn.addEventListener(MouseEvent.CLICK, bioClick);

videos_btn.addEventListener(MouseEvent.CLICK, videosClick);

gallery_btn.addEventListener(MouseEvent.CLICK,photosClick);

map_btn.addEventListener(MouseEvent.CLICK, mapviewClick);

contact_btn.addEventListener(MouseEvent.CLICK, contactClick);

 

 

biografy_btn.TargetMC=biografyPage;

videos_btn.TargetMC=videosPage;

gallery_btn.TargetMC=tattooPage;

map_btn.TargetMC=mapPage;

contact_btn.TargetMC=contactPage;

 

function bioClick(e:MouseEvent):void

{

//removeChild(currentPage.TargetMC);

//tattooPage.shopPage.visible=false;

//tattooPage.artPage.visible=false;

//tattooPage.tattooPage2.visible=false;

 

if(e.target == biografy_btn){

removeChild(currentPage.TargetMC);

SWFAddress.setValue("Biography");

addChild(outPage);

outPage.gotoAndPlay(2);

}

currentPage=MovieClip(e.currentTarget);

addChild(currentPage.TargetMC);

currentPage.TargetMC.gotoAndPlay(2);

}

function photosClick(e:MouseEvent):void

{

if(e.target == gallery_btn){

removeChild(currentPage.TargetMC);

SWFAddress.setValue("TattooGallery");

addChild(outPage);

outPage.gotoAndPlay(2);

}

currentPage=MovieClip(e.currentTarget);

addChild(currentPage.TargetMC);

currentPage.TargetMC.gotoAndPlay(2);

 

}

function videosClick(e:MouseEvent):void

{

 

if(e.target == videos_btn){

removeChild(currentPage.TargetMC);

music_mc.gotoAndStop("music off");

SWFAddress.setValue("Videos");

butterFly.alpha=.5;

addChild(outPage);

outPage.gotoAndPlay(2);

}

if(currentPage == videos_btn)

{

videosPage.lonisvideo.stop();

}

currentPage=MovieClip(e.currentTarget);

addChild(currentPage.TargetMC);

currentPage.TargetMC.gotoAndPlay(2);

 

}

function mapviewClick(e:MouseEvent):void

{

 

if(e.target == map_btn){

removeChild(currentPage.TargetMC);

SWFAddress.setValue("MapView");

butterFly.alpha=.5;

addChild(outPage);

outPage.gotoAndPlay(2);

}

currentPage=MovieClip(e.currentTarget);

addChild(currentPage.TargetMC);

currentPage.TargetMC.gotoAndPlay(2);

 

}

function contactClick(e:MouseEvent):void

{

 

if(e.target == contact_btn){

removeChild(currentPage.TargetMC);

SWFAddress.setValue("Contact");

butterFly.alpha=.5;

addChild(outPage);

outPage.gotoAndPlay(2);

}

currentPage=MovieClip(e.currentTarget);

addChild(currentPage.TargetMC);

currentPage.TargetMC.gotoAndPlay(2);

}

Αρχειοθετημένο

Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.

  • Δημιουργία νέου...