A Flash Developer Resource Site

Results 1 to 17 of 17

Thread: help! simple but i dont understand

  1. #1
    Junior Member
    Join Date
    Jul 2008
    Posts
    12

    help! simple but i dont understand

    i have an extensive website i am designing, a portfolio site. i am new to this but have been working for a long while on it and have been able to figure out most of the actionscripting myself.

    i have one issue. for some reason when i go to a new section within the site, then click the button to return to where i came from the existing buttons there refuse to work. all of them, as if the page is frozen.

    any explanations/ recommendations?

  2. #2
    Junior Member
    Join Date
    Jul 2008
    Posts
    12
    perhaps i was a little unclear. actionscripting is not my expertise as this is the first time i have tried this. is there a reason why my buttons decide to work and then not work? can someone assist me with example script perhaps? the website is structured across one timeline jumping forward and backward per different pieces within the website (ex. portfolio, background, contact, etc.)

  3. #3
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    I think that you'll have to provide more details before anyone will be able to help you. For instance, post some code and any error messages that you are receiving. You may want to install the debug player to catch those errors.

  4. #4
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    Yeah, post the code, and help would be much easier, but first, check to see if the event listeners are being removed.

    And jumping back and forth in the time line, are you using as3 or are you using as2?

  5. #5
    Junior Member
    Join Date
    Jul 2008
    Posts
    12
    I think this may be my biggest problem. I have the error window appear every time that there is an error. On the other hand, there is no errors in the scripting. I am using simple button commands such as gotoandPlay, and gotoandStop. The entire site has been working correctly until I recently was making revisions and included another branch from the portfolio section-of enlarged images. To get to this section it looks like this:

    stop();


    this.Nex_Btn.addEventListener(MouseEvent.CLICK, onButtonClickNextPub);

    function onButtonClickNextPub(event:MouseEvent):void
    {
    // check for the current frame
    switch (this.currentFrame)
    {
    // if the movie is on frame 478 then do something
    case 478: this.gotoAndStop(479); break;

    // if the movie is on frame 479 then do something
    case 479: this.gotoAndStop(480); break;

    // if the movie is on frame 480 then do something
    case 480: this.gotoAndStop(481); break;

    // if the movie is on frame 481 then do something
    case 481: this.gotoAndStop(482); break;

    // if the movie is on frame 482 then do something
    case 482: this.gotoAndStop(483); break;

    // if the movie is on frame 483 then do something
    case 483: this.gotoAndStop(484); break;

    // if the movie is on frame 484 then do something
    case 484: this.gotoAndStop(485); break;

    // if the movie is on frame 485 then do something
    case 485: this.gotoAndStop(486); break;

    // if the movie is on frame 486 then do something
    case 486: this.gotoAndStop(487); break;

    // if the movie is on frame 487 then do something
    case 487: this.gotoAndStop(488); break;

    // if the movie is on frame 488 then do something
    case 488: this.gotoAndStop(489); break;

    // if the movie is on frame 489 then do something
    case 489: this.gotoAndStop(490); break;

    // if the movie is on frame 490 then do something
    case 490: this.gotoAndStop(491); break;

    // if the movie is on frame 491 then do something
    case 491: this.gotoAndStop(492); break;

    // if the movie is on frame 492 then do something
    case 492: this.gotoAndStop(493); break;

    // if the movie is on frame 493 then do something
    case 493: this.gotoAndStop(478); break;
    } // end switch

    }


    this.Prev_Btn.addEventListener(MouseEvent.CLICK, onButtonClickPrevPub);

    function onButtonClickPrevPub(event:MouseEvent):void
    {
    // check for the current frame
    switch (this.currentFrame)
    {
    // if the movie is on frame 478 then do something
    case 478: this.gotoAndStop(493); break;

    // if the movie is on frame 479 then do something
    case 479: this.gotoAndStop(478); break;

    // if the movie is on frame 480 then do something
    case 480: this.gotoAndStop(479); break;

    // if the movie is on frame 481 then do something
    case 481: this.gotoAndStop(480); break;

    // if the movie is on frame 482 then do something
    case 482: this.gotoAndStop(481); break;

    // if the movie is on frame 483 then do something
    case 483: this.gotoAndStop(482); break;

    // if the movie is on frame 484 then do something
    case 484: this.gotoAndStop(483); break;

    // if the movie is on frame 485 then do something
    case 485: this.gotoAndStop(484); break;

    // if the movie is on frame 486 then do something
    case 486: this.gotoAndStop(485); break;

    // if the movie is on frame 487 then do something
    case 487: this.gotoAndStop(486); break;

    // if the movie is on frame 488 then do something
    case 488: this.gotoAndStop(487); break;

    // if the movie is on frame 489 then do something
    case 489: this.gotoAndStop(488); break;

    // if the movie is on frame 490 then do something
    case 490: this.gotoAndStop(489); break;

    // if the movie is on frame 491 then do something
    case 491: this.gotoAndStop(490); break;

    // if the movie is on frame 492 then do something
    case 492: this.gotoAndStop(491); break;

    // if the movie is on frame 493 then do something
    case 493: this.gotoAndStop(492); break;
    } // end switch

    }


    this.Enlarge_Btn.addEventListener(MouseEvent.CLICK , onButtonClickEnlargePub);

    function onButtonClickEnlargePub(event:MouseEvent):void
    {
    // check for the current frame
    switch (this.currentFrame)
    {
    // if the movie is on frame 478 then do something
    case 478: this.gotoAndPlay(1156); break;

    // if the movie is on frame 479 then do something
    case 479: this.gotoAndPlay(1181); break;

    // if the movie is on frame 480 then do something
    case 480: this.gotoAndPlay(1206); break;

    // if the movie is on frame 481 then do something
    case 481: this.gotoAndPlay(1231); break;

    // if the movie is on frame 482 then do something
    case 482: this.gotoAndPlay(1256); break;

    // if the movie is on frame 483 then do something
    case 483: this.gotoAndPlay(1281); break;

    // if the movie is on frame 484 then do something
    case 484: this.gotoAndPlay(1306); break;

    // if the movie is on frame 485 then do something
    case 485: this.gotoAndPlay(1331); break;

    // if the movie is on frame 486 then do something
    case 486: this.gotoAndPlay(1356); break;

    // if the movie is on frame 487 then do something
    case 487: this.gotoAndPlay(1381); break;

    // if the movie is on frame 488 then do something
    case 488: this.gotoAndPlay(1406); break;

    // if the movie is on frame 489 then do something
    case 489: this.gotoAndPlay(1431); break;

    // if the movie is on frame 490 then do something
    case 490: this.gotoAndPlay(1456); break;

    // if the movie is on frame 491 then do something
    case 491: this.gotoAndPlay(1481); break;

    // if the movie is on frame 492 then do something
    case 492: this.gotoAndPlay(1506); break;

    // if the movie is on frame 493 then do something
    case 493: this.gotoAndPlay(1531); break;

    } // end switch

    }

    Then once to the larger images portfolio section on the timeline, the script looks like this:

    gotoAndStop(1180);

    This allows the site to continue to play through an intro transition to the next section of about 20 frames, then heads to the next frame and appears as this:

    stop();


    this.Close_Btn.addEventListener(MouseEvent.CLICK, onButtonClickClosePub1);

    function onButtonClickClosePub1(event:MouseEvent):void
    {
    // check for the current frame
    switch (this.currentFrame)
    {
    // if the movie is on frame 1180 then do something
    case 1180: this.gotoAndStop(478); break;
    }
    }

    Next_Btn.addEventListener(MouseEvent.CLICK, mouseDownHandlerEnlargeNextPub1);
    function mouseDownHandlerEnlargeNextPub1(event:MouseEvent): void {
    gotoAndStop(1205);
    }

    Prev_Btn.addEventListener(MouseEvent.CLICK, mouseDownHandlerEnlargePrevPub1);
    function mouseDownHandlerEnlargePrevPub1(event:MouseEvent): void {
    gotoAndStop(1555);
    }



    Simply put, all of this works. But when the close button (Close_Btn)is clicked it takes the viewer back to where it should, but the buttons there do nothing.

    Ideas?

  6. #6
    Junior Member
    Join Date
    Jul 2008
    Posts
    12

    More Information:

    I think this may be my biggest problem. I have the error window appear every time that there is an error. On the other hand, there is no errors in the scripting. I am using simple button commands such as gotoandPlay, and gotoandStop. The entire site has been working correctly until I recently was making revisions and included another branch from the portfolio section-of enlarged images. To get to this section it looks like this:

    stop();


    this.Nex_Btn.addEventListener(MouseEvent.CLICK, onButtonClickNextPub);

    function onButtonClickNextPub(event:MouseEvent):void
    {
    // check for the current frame
    switch (this.currentFrame)
    {
    // if the movie is on frame 478 then do something
    case 478: this.gotoAndStop(479); break;

    // if the movie is on frame 479 then do something
    case 479: this.gotoAndStop(480); break;

    // if the movie is on frame 480 then do something
    case 480: this.gotoAndStop(481); break;

    // if the movie is on frame 481 then do something
    case 481: this.gotoAndStop(482); break;

    // if the movie is on frame 482 then do something
    case 482: this.gotoAndStop(483); break;

    // if the movie is on frame 483 then do something
    case 483: this.gotoAndStop(484); break;

    // if the movie is on frame 484 then do something
    case 484: this.gotoAndStop(485); break;

    // if the movie is on frame 485 then do something
    case 485: this.gotoAndStop(486); break;

    // if the movie is on frame 486 then do something
    case 486: this.gotoAndStop(487); break;

    // if the movie is on frame 487 then do something
    case 487: this.gotoAndStop(488); break;

    // if the movie is on frame 488 then do something
    case 488: this.gotoAndStop(489); break;

    // if the movie is on frame 489 then do something
    case 489: this.gotoAndStop(490); break;

    // if the movie is on frame 490 then do something
    case 490: this.gotoAndStop(491); break;

    // if the movie is on frame 491 then do something
    case 491: this.gotoAndStop(492); break;

    // if the movie is on frame 492 then do something
    case 492: this.gotoAndStop(493); break;

    // if the movie is on frame 493 then do something
    case 493: this.gotoAndStop(478); break;
    } // end switch

    }


    this.Prev_Btn.addEventListener(MouseEvent.CLICK, onButtonClickPrevPub);

    function onButtonClickPrevPub(event:MouseEvent):void
    {
    // check for the current frame
    switch (this.currentFrame)
    {
    // if the movie is on frame 478 then do something
    case 478: this.gotoAndStop(493); break;

    // if the movie is on frame 479 then do something
    case 479: this.gotoAndStop(478); break;

    // if the movie is on frame 480 then do something
    case 480: this.gotoAndStop(479); break;

    // if the movie is on frame 481 then do something
    case 481: this.gotoAndStop(480); break;

    // if the movie is on frame 482 then do something
    case 482: this.gotoAndStop(481); break;

    // if the movie is on frame 483 then do something
    case 483: this.gotoAndStop(482); break;

    // if the movie is on frame 484 then do something
    case 484: this.gotoAndStop(483); break;

    // if the movie is on frame 485 then do something
    case 485: this.gotoAndStop(484); break;

    // if the movie is on frame 486 then do something
    case 486: this.gotoAndStop(485); break;

    // if the movie is on frame 487 then do something
    case 487: this.gotoAndStop(486); break;

    // if the movie is on frame 488 then do something
    case 488: this.gotoAndStop(487); break;

    // if the movie is on frame 489 then do something
    case 489: this.gotoAndStop(488); break;

    // if the movie is on frame 490 then do something
    case 490: this.gotoAndStop(489); break;

    // if the movie is on frame 491 then do something
    case 491: this.gotoAndStop(490); break;

    // if the movie is on frame 492 then do something
    case 492: this.gotoAndStop(491); break;

    // if the movie is on frame 493 then do something
    case 493: this.gotoAndStop(492); break;
    } // end switch

    }


    this.Enlarge_Btn.addEventListener(MouseEvent.CLICK , onButtonClickEnlargePub);

    function onButtonClickEnlargePub(event:MouseEvent):void
    {
    // check for the current frame
    switch (this.currentFrame)
    {
    // if the movie is on frame 478 then do something
    case 478: this.gotoAndPlay(1156); break;

    // if the movie is on frame 479 then do something
    case 479: this.gotoAndPlay(1181); break;

    // if the movie is on frame 480 then do something
    case 480: this.gotoAndPlay(1206); break;

    // if the movie is on frame 481 then do something
    case 481: this.gotoAndPlay(1231); break;

    // if the movie is on frame 482 then do something
    case 482: this.gotoAndPlay(1256); break;

    // if the movie is on frame 483 then do something
    case 483: this.gotoAndPlay(1281); break;

    // if the movie is on frame 484 then do something
    case 484: this.gotoAndPlay(1306); break;

    // if the movie is on frame 485 then do something
    case 485: this.gotoAndPlay(1331); break;

    // if the movie is on frame 486 then do something
    case 486: this.gotoAndPlay(1356); break;

    // if the movie is on frame 487 then do something
    case 487: this.gotoAndPlay(1381); break;

    // if the movie is on frame 488 then do something
    case 488: this.gotoAndPlay(1406); break;

    // if the movie is on frame 489 then do something
    case 489: this.gotoAndPlay(1431); break;

    // if the movie is on frame 490 then do something
    case 490: this.gotoAndPlay(1456); break;

    // if the movie is on frame 491 then do something
    case 491: this.gotoAndPlay(1481); break;

    // if the movie is on frame 492 then do something
    case 492: this.gotoAndPlay(1506); break;

    // if the movie is on frame 493 then do something
    case 493: this.gotoAndPlay(1531); break;

    } // end switch

    }

    Then once to the larger images portfolio section on the timeline, the script looks like this:

    gotoAndStop(1180);

    This allows the site to continue to play through an intro transition to the next section of about 20 frames, then heads to the next frame and appears as this:

    stop();


    this.Close_Btn.addEventListener(MouseEvent.CLICK, onButtonClickClosePub1);

    function onButtonClickClosePub1(event:MouseEvent):void
    {
    // check for the current frame
    switch (this.currentFrame)
    {
    // if the movie is on frame 1180 then do something
    case 1180: this.gotoAndStop(478); break;
    }
    }

    Next_Btn.addEventListener(MouseEvent.CLICK, mouseDownHandlerEnlargeNextPub1);
    function mouseDownHandlerEnlargeNextPub1(event:MouseEvent): void {
    gotoAndStop(1205);
    }

    Prev_Btn.addEventListener(MouseEvent.CLICK, mouseDownHandlerEnlargePrevPub1);
    function mouseDownHandlerEnlargePrevPub1(event:MouseEvent): void {
    gotoAndStop(1555);
    }



    Simply put, all of this works. But when the close button (Close_Btn)is clicked it takes the viewer back to where it should, but the buttons there do nothing.

    Ideas?

  7. #7
    Junior Member
    Join Date
    Jul 2008
    Posts
    12
    Sorry for the duplicate post, my internet froze momentarily.

  8. #8
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    Is there any way you could post a source FLA? I'll have to look at it in just a bit as I'll be away from the pc for a min, but if you can do that it may help.

  9. #9
    Junior Member
    Join Date
    Jul 2008
    Posts
    12
    Honestly, I don't even know how to do so. .like I said I am a bit new to this

  10. #10
    Junior Member
    Join Date
    Jul 2008
    Posts
    12
    This issue sounds so simple to fix, and I am getting quite frustrated by it. Everything works how it is supposed to but when returning back to previously visiting frames the buttons become inactive--what did I do? There are apparently no scripting errors according to flash. . .it just does not work how it is supposed to.

  11. #11
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    Okay, well I'm going to try to trouble shoot this, but what I'm seeing now is this:

    You have a bunch of events dependent upon the currentframe of the movie. That's fine, although there are better ways to do this sort of thing. This is something a lot of people did with as2.

    Anyway, what you have should work, but at what point does the movie quit working? Is it only when you click the close_btn?

    Also, why are you using gotoAndStop(1180)? What's there?

    Try putting some trace statements on each button case so you can see if flash is recognizing the button click. Also, check your output panel, sometimes errors come up there as well rather than the compiler error window.

    Check these and get back to me. Also, how big is your FLA file? I may have you email it to me for review if this doesn't work.

  12. #12
    Junior Member
    Join Date
    Jul 2008
    Posts
    12
    Ok. Sorry I am going the long way to do this, I was never taught how to go about scripting therefore I am self-taught. The file quits working while going from the large image section of the timeline back to the previous section (not really in sections -- just easier to explain) by hitting the Close Button.

    I am employing the "gotoAndStop(1180)" when the Enlarge button is clicked -- This button states to gotoAndPlay(whichever frame) where eventually after twenty or so frames runs into the " " and moves one more frame to the portfolio section. The twenty frames are just a transition I had designed to take the website from one section to another. I chose to use the " " that way I would not have to script a stop();. I did not want to have stops after each image because each frame(image) has next, previous, and the close buttons on it -- which I did not want to have to claim new instances for. Hope that makes sense.

    As far as the trace statements go, nothing appears on the output nor error panels. It claims to be working correctly.

    My .fla file is 52.8 MB, and my .swf file is 7MB

    Thanks for the help, hurry back

  13. #13
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    Wow, Is there any way you can upload it to your web server and post a link for download? I feel I may have to see what's going on in the fla.

  14. #14
    Junior Member
    Join Date
    Jul 2008
    Posts
    12
    I would if I knew how. . Is my issue really that uncommon?

  15. #15
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    Uncommon, no, but issues like that usually reside somewhere within the file, because your code is working.

    All you'd have to do is FTP the file to a webserver like you would any other HTML.

    Would you like my email to continue on this?

  16. #16
    Junior Member
    Join Date
    Jul 2008
    Posts
    12
    Is it possible to just email you the .swf file so you can see exactly what I am referring to? If so/not I will be able to email/upload it to the server tomorrow.

  17. #17
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    We can try that.

    jonathon.weeks@gmail.com

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