A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Timer Event Problems (Syntax Errors)

  1. #1
    Senior Member
    Join Date
    Jul 2000
    Posts
    373

    Timer Event Problems (Syntax Errors)

    I'm creating a simple slideshow that just goes from one slide to the next every 10 seconds. I'm using the Timer Event to do this but when I try the following script, I get nothing but a bunch of syntax errors on lines 9 and 26 with no further explanation. I think my syntax is correct so can someone look at this script and tell me where I'm screwing up?

    --

    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    import flash.utils.*;

    var inTween:Tween;
    var outTween:Tween;
    var timeTween:Timer = new Timer(1000);

    slide1_mc.alpha=100;
    slide2_mc.alpha=0;
    slide3_mc.alpha=0;
    slide4_mc.alpha=0;
    slide5_mc.alpha=0;
    slide6_mc.alpha=0;
    slide7_mc.alpha=0;
    slide8_mc.alpha=0;
    slide9_mc.alpha=0;

    var slides:Array=[slide1_mc,slide2_mc,slide3_mc,slide4_mc,slide5_mc, slide6_mc,slide7_mc,slide8_mc,slide9_mc];
    var showingIndex:int=0;

    timeTween.addEventListener(”timer”, slide);
    timeTween.start();

    function slide(eventArgs:TimerEvent) {
    trace(”Timer fired ” + timeTween.currentCount + ” times.”);
    if (showingIndex==8) {
    return;
    }
    outTween=new Tween(slides[showingIndex],"alpha",None.easeNone,1,0,1,true);
    inTween=new Tween(slides[showingIndex+1],"alpha",None.easeNone,0,1,1,true);
    showingIndex++;
    }
    Adam Bell
    dzign@datatv.com
    --
    Over 90% of all websites
    suck......
    Join the minority.

  2. #2
    Senior Member
    Join Date
    Apr 2008
    Location
    Nottingham, UK
    Posts
    348
    the only thing I can see is that your alpha value for the first MC should be 1 not 100.

    Is the slide() function ok to return null without a return datatype? Finally from what I can see you haven't provided a description for the None.easeNone function which you've passed to the new Tween function, although that could of course be a static function in the tween class...

    Dan

  3. #3
    Senior Member
    Join Date
    Jul 2000
    Posts
    373
    I used the slide function on a different .fla where the slideshow was guided by buttons instead of time. None.easeNone also came from the same exact script so if it worked there it should work here.
    Adam Bell
    dzign@datatv.com
    --
    Over 90% of all websites
    suck......
    Join the minority.

  4. #4
    Senior Member
    Join Date
    Jul 2005
    Posts
    165
    your code works fine for me - is it possible that you are missing instance names for clips on stage?
    If that's not the case, it may be helpful to include the contents of the error messages you get.

  5. #5
    Senior Member
    Join Date
    Jul 2000
    Posts
    373
    I believe the instance names are on the stage. Here's the FLA (minus the photos) with the clips on the stage.
    Last edited by databell; 07-22-2010 at 02:11 PM.
    Adam Bell
    dzign@datatv.com
    --
    Over 90% of all websites
    suck......
    Join the minority.

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