Flash Actionscript - on Release GetURL not working with movieclip animation

Discussion in 'Programming' started by kurtstoll, Dec 22, 2009.

  1. #1
    I am a Noob to Flash/Actionscript and am having problems getting some movieclips to link to different URLs on release. I am able to get them to animate, and I am able to get them to link to an html page in the same folder, but I can’t get both functionalities to work at the same time and it is driving me crazy!! I've tried putting the actionscript in the instance object, in the action layer, and other things and nothing seems to work!?


    Here is the link to the source file: http://www.myfavorites.com/flashtest/header_v8_122209_v2.fla
    I believe that the actionscripting needs to be done in the "baners" movieclip, but it could also be the "Symbol 3" movieclip. I'm not sure and this is where I also need help.


    Here is also a link to the .swf (http://www.myfavorites.com/flashtest/header_v8_122209_v2.swf). See, if you mouse over the first two clips, they animate, but they do not go to the HTML page if you click on them (http://www.myfavorites.com/flashtest/success1.html). The third clip will go to the page success1.html in the same folder if you click on it, but it does not animate on mouse over.


    I'm using Flash CS3 as my editor and I'm using ActionScript 2.0 for the scripting.

    Any help you can provide on this is most appreciated!! I'm normally pretty good at figuring out things on my own, but This problem is driving me crazy!!
     
    kurtstoll, Dec 22, 2009 IP
  2. yoes_san

    yoes_san Peon

    Messages:
    443
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The third button works for me.

    I didn't see a script that handle another 2 buttons though.

    Nice flash by the way.
     
    yoes_san, Dec 22, 2009 IP
  3. kurtstoll

    kurtstoll Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks Yoes_san,


    Thanks for responding. First, full disclosure. I purchased this .FLA from TemplateMonster.com and am trying to modify it for a client. This is why I don't understand some of the coding.

    That being said, I have tried three different methods to get this to work (none at the same time). Two where I insert ActiveScript into each instance of the movieclip and another where I insert ActiveScript into the timeline. Below I have listed what I used and the results of each attempt. Any help or guidance you can provide is much appreciated.


    Here is what I am trying with ActionScript in the timeline:

    ==============================================




    I have three instances of the "Symbol 3" movieclip inside of the "Baners" movieclip. The instances are named "item1", "item2" and "item3". Here is what I am trying at the beginning of the timeline for each instance of the "Symbol 3" movieclip like so:

    this.onMouseDown = function() {
    this.getURL("success1.html", "_self");
    }

    but modify it so that each one points to a different page, it doesn't work right. Here is what I did more explicitly:

    -----------------------------------------------------

    For the "item1" instance of the "Symbol 3' movieclip inside of the "Baners" movieclip, I put the following actionscript into the 1st frame of the timeline for that instance:

    this.onMouseDown = function() {
    this.getURL("success1.html", "_self");
    }

    For the "item2" instance of the "Symbol 3' movieclip inside of the "Baners" movieclip, I put the following actionscript into the 1st frame of the timeline for that instance:

    this.onMouseDown = function() {
    this.getURL("success2.html", "_self");
    }

    For the "item3" instance of the "Symbol 3' movieclip inside of the "Baners" movieclip, I put the following actionscript into the 1st frame of the timeline for that instance:

    this.onMouseDown = function() {
    this.getURL("success3.html", "_self");
    }

    -----------------------------------------------------
    Results:

    - Animation works

    - Links do not work as intended (ie. No matter which clip I click on, they all take me to success3.html, instead of the different pages I specified).

    -----------------------------------------------------






    Here is what I am trying with ActionScript in the different instances:

    ======================================================



    1st Attempt:

    -------------------




    For the "item1" instance of the "Symbol 3' movieclip inside of the "Baners" movieclip, I put the following actionscript into the Actions for that instance:



    onClipEvent (load) {
    num = 1;
    }
    on (release) {
    getURL("success1.html", "_self");
    }





    For the "item2" instance of the "Symbol 3' movieclip inside of the "Baners" movieclip, I put the following actionscript into the Actions for that instance:



    onClipEvent (load) {
    num = 2;
    }
    on (release) {
    getURL("success2.html", "_self");
    }



    For the "item3" instance of the "Symbol 3' movieclip inside of the "Baners" movieclip, I put the following actionscript into the Actions for that instance:



    onClipEvent (load) {
    num = 3;
    }
    on (release) {
    getURL("success3.html", "_self");
    }



    -----------------------------------------------------
    Results for 1st Attempt:

    - Animation does not work

    - Links do work

    -----------------------------------------------------







    2nd Attempt:

    --------------------



    For the "item1" instance of the "Symbol 3' movieclip inside of the "Baners" movieclip, I put the following actionscript into the Actions for that instance:

    this.item1.onMouseDown = function() {
    this.item1.getURL("success1.html", "_self");
    }

    For the "item2" instance of the "Symbol 3' movieclip inside of the "Baners" movieclip, I put the following actionscript into the Actions for that instance:

    this.item2.onMouseDown = function() {
    this.item2.getURL("success2.html", "_self");
    }

    For the "item3" instance of the "Symbol 3' movieclip inside of the "Baners" movieclip, I put the following actionscript into the Actions for that instance:

    this.item3.onMouseDown = function() {
    this.item3.getURL("success3.html", "_self");
    }



    -----------------------------------------------------
    Results for 2nd Attempt:

    - Animation works

    - Links do not work

    -----------------------------------------------------


    Again, any help or guidance you can provide is much appreciated.
     
    kurtstoll, Dec 26, 2009 IP
  4. Accountant1

    Accountant1 Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Quick Question... were you able to solve this problem? I have almost the exact same coding and issue.
     
    Accountant1, Jan 19, 2010 IP