Skip navigation
Currently Being Moderated

ERROR 1034

Jul 16, 2012 3:37 PM

Tags: #actionscript_3

HELLO ALL, I HAVE A QUESTION PLEASE HELP ME, I HAVE AN APPLICATION WHERE I HAVE A SPRITE CONTAINER WHERE I ADDCHILD MOVIE CLIPS WITH AN XML INFORMATION DATA LOADED, AND A SCROLLING MOUSE FUNCTION WITH A TWEEN EFFECTS. BUT WHEN I TESTED IT TURNS IN THE OUT THE NEXT ERROR "

 

Forced conversion error 1034, can not convert flash display :: Loader @ 29e80041 flash display.MovieClip

 

THANKS IN ADVANCE.

 

REGARDS

JOSELYN

 
Replies
  • kglad
    72,228 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 16, 2012 3:47 PM   in reply to Joselyn6

    click file>publish settings>swf and tick "permit debugging".  retest.

     

    copy and paste the error message and copy the problematic line of code mentioned in the error message.

     
    |
    Mark as:
  • kglad
    72,228 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 17, 2012 4:56 PM   in reply to Joselyn6

    which is line 65?

     

    and

     

    var newsItem:NewsItem = new NewsItem;

     

    should be

     

    var newsItem:NewsItem = new NewsItem();

     
    |
    Mark as:
  • kglad
    72,228 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 20, 2012 12:15 PM   in reply to Joselyn6

    this.parent is the stage, not a movieclip.  use:

     

     


    // XML LISTS //
    // ========= //


    var newsTitle:XMLList;
    var newsInfo:XMLList;
    var newsContent:XMLList;

    var newsTitleArray:Array;
    var newsInfoArray:Array;
    var newsContentArray:Array;

    // number of items

    var newsNum:Number;

    // LOAD XML //
    // ======== //

    var xml:XMLLoader = new XMLLoader(this,"data.xml");

    // function called when XML is loaded
    function getXML(xmlData:XML):void {


    newsTitle = xmlData.news.article.title;
    newsInfo = xmlData.news.article.info;
    newsContent = xmlData.news.article.content;

    newsNum = newsTitle.length();
    //trace(projectInfo);

    newsTitleArray = xmlData.news.article.title.text().toXMLString().split("\n") ;
    newsTitleArray.reverse();

    newsInfoArray = xmlData.news.article.info.text().toXMLString().split("\n") ;
    newsInfoArray.reverse();

    newsContentArray = xmlData.news.article.content.text().toXMLString().split("\n") ;
    newsContentArray.reverse();



    }


    // CREATING NEWS ENTRIES

    // news container for easier scrolling
    var newsContainer:Sprite = new Sprite;
    newsContainer.y = -newsContainer.height-stage.stageHeight/2;
    addChild(newsContainer);

     

    // storing references into array for later access
    var newsArray:Array = new Array( );

    // XML //

    var MC2:MovieClip = MovieClip(this);
    var newsHeight:Number=0;

    // creating instances of NewsItem movieclips that will later be determined by XML
    for(var k:Number=0;k<MC2.newsNum;k++) {

    var newsItem:NewsItem = new NewsItem();

    // XML INPUT

    newsItem.title.text = MC2.newsTitle[MC2.newsNum-1-k];
    newsItem.content.htmlText = MC2.newsContent[MC2.newsNum-1-k];
    newsItem.info.text = MC2.newsInfo[MC2.newsNum-1-k];
    newsItem.positionRule();

    trace(newsItem.content.textHeight);
    // positioning NewsItems moveiclips
    // will later be determined by XML data
    if(k>0) {
     
      newsItem.y = newsHeight;
     
    }
    newsArray.push(newsItem);
    // adding newsItems as children to newsContainer
    newsContainer.addChild(newsItem);
    newsHeight += newsItem.content.textHeight+100;
    trace(k + " " + newsHeight);
    }


    // VERTICLE MOUSE_MOVE SCROLLING

    stage.addEventListener(MouseEvent.MOUSE_MOVE, scrollNews);

    function scrollNews(evt:MouseEvent):void {

    TweenLite.to(newsContainer, 0.3, { y:-(stage.mouseY/stage.stageHeight)*newsContainer.height+ newsHeight/2});
    trace(-(stage.mouseY/stage.stageHeight)*newsContainer.height);
    }

     

    p.s.  please mark helpful/correct responses.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points