A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: navigateToURL problem

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

    navigateToURL problem

    I've got a slide show going on and the client wants it when it reaches the final slide, the next click of the right arrow button takes you to a URL. Thought I had it down in an if statement but it's not working. Can someone look at my code and comment on a possible fix? Thanks.
    --
    var slides:Array=[slide1_mc,slide2_mc,slide3_mc,slide4_mc,slide5_mc, slide6_mc,slide7_mc,slide8_mc,slide9_mc,slide10_mc ,slide11_mc,slide12_mc,slide13_mc,slide14_mc,slide 15_mc,slide16_mc,slide17_mc,slide18_mc,slide19_mc, slide20_mc,slide21_mc,slide22_mc,slide23_mc,slide2 4_mc];
    var showingIndex:int=0;

    rightArrow_btn.addEventListener(MouseEvent.MOUSE_D OWN, slide_right);
    leftArrow_btn.addEventListener(MouseEvent.MOUSE_DO WN, slide_left);

    function slide_right(event:MouseEvent):void {
    if (showingIndex==23) {
    return;
    navigateToURL(new URLRequest("this.html"), '_self');
    }
    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++;
    copy_mc.nextFrame();
    }
    Adam Bell
    dzign@datatv.com
    --
    Over 90% of all websites
    suck......
    Join the minority.

  2. #2
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    When you use a return, it ejects out of the function and doesn't run any other code - so if you move that down underneath the navigateToURL() it should work.

  3. #3
    Senior Member
    Join Date
    Jul 2000
    Posts
    373
    Thanks. It worked great.
    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