As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

Beginner ActionScript 3.0 Help

MayGodHaveMercyMayGodHaveMercy Registered User regular
edited August 2010 in Help / Advice Forum
Okay, so I'm trying to add a photo gallery to a website I'm building for my parents. I'm using this tutorial.

The problem is, that tutorial is for far older versions of Flash, so I've had to change up the code a little bit, and I'm not totally competent with AS. So, here's my problem...

I have the following code:
stop();
thumb0.addEventListener(MouseEvent.CLICK, release);
function release(evt:MouseEvent):void {
photos.gotoAndPlay("img0");
}
stop();
thumb1.addEventListener(MouseEvent.CLICK, release);
function release(evt:MouseEvent):void {
photos.gotoAndPlay("img1");
}

That's two instances of it. I actually have 6 total. The line that's giving me problems is function release(evt:MouseEvent):void. Now, I know that all I need to do to fix it is add numbers to a certain spot in that line, so I have 1,2,3,4 etc. I just don't know where the identifier needs to go. Is it right after MouseEvent? and only on that one line? Or should each mouse event (per instance) have the same identifier?

Thanks in advance!


EDIT: Here's a screenshot that might be easier on the eyes. Lines 110, 115, 120, 125, and 130 are the duplicate lines the compiler doesn't like.
1021.jpg

EDIT AGAIN: I took out the stops, as I'm pretty sure they are not needed at all.

XBL: Mercy XXVI - Steam: Mercy_XXVI - PSN: Mercy XXVI
MayGodHaveMercy on

Posts

  • Options
    MayGodHaveMercyMayGodHaveMercy Registered User regular
    edited August 2010
    You can lock this thread. I figured it out.

    thumb1.addEventListener(MouseEvent.CLICK, release1);
    function release1(evt:MouseEvent):void {

    MayGodHaveMercy on
    XBL: Mercy XXVI - Steam: Mercy_XXVI - PSN: Mercy XXVI
Sign In or Register to comment.