A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] Tutorial Code Not Working

  1. #1
    Junior Member
    Join Date
    May 2009
    Posts
    19

    resolved [RESOLVED] Tutorial Code Not Working

    I really hate when you read a tutorial from some "expert" and what it tells you to do is wrong.

    I was doing a tutorial for a XML slide show, and the last line of code doesn't work quite right:

    function timerListener (e:TimerEvent):void{

    my_playback_counter++;
    if (my_playback_counter == my_total){
    my_playback_counter =0;
    }
    nextImage();

    }

    For some reason that only sends the my_playback_counter to 1. And it just sits there twitching. So when I tried to change the tutorial code to:

    function timerListener (e:TimerEvent):void{

    if (my_playback_counter <= my_total){
    my_playback_counter++;
    }
    else {
    my_playback_counter = 0;
    }
    nextImage();

    }

    It plays through to the last image, and then I get this Output message:

    TypeError: Error #2007: Parameter child must be non-null.
    at flash.display:isplayObjectContainer/addChild()
    at slideShowXML_fla::MainTimeline/nextImage()
    at slideShowXML_fla::MainTimeline/timerListener()
    at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
    at flash.utils::Timer/flash.utils:Timer::tick()


    Sometimes I just hate programming...

    Thanks in advance

  2. #2
    rabid_Delineator AttackRabbit's Avatar
    Join Date
    Dec 2003
    Location
    Orlando, Florida
    Posts
    481
    It's difficult to discern your problem from the information you have provided. I can tell you that your problem , at least with your adjusted code , is originating from the nextImage method. Something is trying to be added as a child to a display object that does not exist. As for the original issue , i dont really know where to begin. Have you tried tracing out values for my_playback_counter , my_total ? How is this tutorial being used ? I can see that your code is just on the timeline somewhere , that might be part of the problem.

  3. #3
    Junior Member
    Join Date
    May 2009
    Posts
    19
    Thanks AttackRabbit (cool name BTW),

    I don't have the code right in front of me tonight, I'll check it out tomorrow, and see if I can get it to work right.

  4. #4
    Junior Member
    Join Date
    May 2009
    Posts
    19
    I don't know exactly what I did wrong, and I don't know what I did to fix it, but for some reason I got it working

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center