Page 1 of 2 12 LastLast
Results 1 to 15 of 24

Thread: Flash MX 2004 Action Script confusion!!

  1. #1
    Junior Registered
    Join Date
    Mar 2004
    Posts
    3

    Question Flash MX 2004 Action Script confusion!!

    First, I'll admit that I'm a complete noob when it comes to coding in Flash. Now, here's what's frustrating me - I recently purchased "Flash Advanced" from Peachpit Press so that I could just try to get my hands around Action Script. I just wanted to do something very simple: create a button with a getURL link. The book says that the code for the button should look like this:

    button_name.onRelease = function() {
    getURL("http://www.myurl.com");
    };


    But, that only gives me a syntax error which reads:

    **Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 1: Statement must appear within on handler

    Now, if I use what I suppose would be considered obsolete syntax:

    on(release) {
    getgetURL("http://www.myurl.com")
    }


    it works just fine with no errors.

    So, what's going on? What's all this "new" Action Script about if it doesn't work?

  2. #2
    Junior Registered
    Join Date
    Mar 2004
    Posts
    3
    OK, forget it. I discovered that the code in the book was a FRAME action. Applying it to the frame I wanted allowed it to work properly.

  3. #3
    Senior Member thebillionaire's Avatar
    Join Date
    Apr 2004
    Posts
    746
    The first codes work but I think that the only problem is that you may have put the code

    " button_name.onRelease = function() {
    getURL("http://www.myurl.com");
    }; "

    inside the buttons action script. you must put it into a frame where the button is located. The other code you had was

    "on(release){
    getgetURL("http://www.myurl.com")
    } "

    this will not work because the there is no getgetURL function, but there is a getURL function, so the code should look something like this.

    on(release){
    getURL("http://www.myurl.com")
    }

  4. #4
    Junior Registered
    Join Date
    Mar 2004
    Posts
    3
    Thanks, Crusader!

  5. #5
    Senior Member thebillionaire's Avatar
    Join Date
    Apr 2004
    Posts
    746

    Your Welcome

    your Welcome. If you need any more help just ask me.

  6. #6
    Registered
    Join Date
    Sep 2003
    Posts
    110
    I recently bought Flash 2004 but not enough time to learn and play with it.
    Seems to have a high learning curve.
    Someday...I'll be able to do some neat stuff.

  7. #7
    Senior Member thebillionaire's Avatar
    Join Date
    Apr 2004
    Posts
    746

    lol

    lol, yea someday

  8. #8
    Junior Registered
    Join Date
    Apr 2004
    Location
    norman arkansas
    Posts
    1
    I'm sorry if this is a repeated post, but I had to disconnect in the middle of it.

    I need help with Flash Mx 2004.

    I learned how to apply action to buttons in Flash MX. I have the book telling me how, but now I am working in Flash MX 2004 and I don't know how to do it.

    I need know how to apply back actions , go to and play, and go to and stop actions.

    I need to finish my web page before Tuesday in order to graduate. I haven't yet figured out how to operate that part of the system and need help.

    My web site starts with a movie clip then opens to the home page. They are on the timeline.

    The scenes work differently in the 2004 version also. I have several scenes that are literally pages with thumbnail buttons (and a movie clip if I figure out the actions). These thumbnail buttons each open to display a page with a larger image of the thumbnail button. Should I have put them scenes on the timeline as well?

    I noticed the billionaire checks the forum quite often. I hope he/she/somebody will take the time to help me.

    Thanks a Lot
    PARS
    pars

  9. #9
    Senior Member thebillionaire's Avatar
    Join Date
    Apr 2004
    Posts
    746
    I don’t understand what you're question is, what do you want to do with the button make it go to another position on the timeline? Just tell me the problem and if you can upload the flash part (.swf) on the web, this would help me.

    If you want a page to load your flash swf then sign up with this free web host.

    http://members.freewebs.com/

    Or another you would like.

    You can also add me to msn messenger and we can talk in more detail. my email is:

    shamimsaad03@hotmail.com

    reply as soon as possible because I want to help to graduate.

    If you need more help with graphics action scripts ect. just ask I have won the goldenweb award and other awards for my flash sites.
    P.S I’m a boy.
    Last edited by thebillionaire; 04-30-2004 at 02:00 PM.

  10. #10
    Senior Member thebillionaire's Avatar
    Join Date
    Apr 2004
    Posts
    746
    The easiest way to do action scripts is copy the script from flash mx and paste it into mx 2004, but there are no quick action scripts for 2004. If you want to go to the previous scene type this into the "back button", covert the back button to a button not a movie clip:

    on (release) {
    gotoAndStop("Scene 1", 1);
    }

    replace scene 1 to what ever you named your scenes, and the 1 after Scene 1 is the frame where the button links to. gotoAndStop will make the script stop at the frame or if you don’t want to freeze at Scene 1 and frame 1 then change "Stop" to Play , so it would look something like this:

    on (release) {
    gotoAndPlay("Scene 1", 1);
    }

    Or to just go to the previous scene type this in:

    on (release) {
    prevScene();
    }

    For the buttons that are linked to pages use:

    on(release){
    getURL("http://www.myurl.com")
    }

    replace myurl to any page, but don’t delete the "" marks.

    Finally for hidden buttons that are triggered on roll over type this in:

    on (rollOver) {
    gotoAndPlay(1);
    }

    assuming that your movie clip starts at frame one.

    It doesn’t matter much if you make you site on scene's or frame's, it depends on what you find easier. To copy frame's you have to select all the frame's you want copied, right click on any frame and clip copy (Ctrl+C wont work), then right click on a blank frame and click paste.

    Hope that help's, if there is anything you need help in just ask.

    I have posted this on website publisher just incase you lose this copy.

  11. #11
    Senior Member thebillionaire's Avatar
    Join Date
    Apr 2004
    Posts
    746
    any one else need help?

  12. #12
    Registered
    Join Date
    Jan 2004
    Location
    London, UK
    Posts
    229
    me But i'll put it in a new thread because, erm, dunno really

  13. #13
    Senior Member thebillionaire's Avatar
    Join Date
    Apr 2004
    Posts
    746
    Ok Guys alot of people are emailing me for help, which is perfectly fine but if my inbox is full try emailing me again.

  14. #14
    Registered
    Join Date
    Sep 2003
    Posts
    110
    How long did it take you to be where you at now thebillionaire?

  15. #15
    Junior Registered
    Join Date
    May 2004
    Posts
    1
    Hey I need some help thebillionaire!

    I'm new to Flash also and can't seem to figure out this gotoAndPlay/gotoAndStop actions.

    I'm trying to make a condition in the first frame of the main timeline to go to the end of the flash movie and stop playing. This is so that the movie only plays once upon loading, but doesn't play again between web page changes. I'm using this as a header/menu type flash movie. The problem is when I use the gotoAndStop function to move to the end, it would stop the movie completely instead of moving the playhead to the end. The movie would stop at the beginning and would not play at all. If I use the gotoAndPlay, then it wouldn't move to the end but instead plays the whole movie as if this command wasn't there.

    I've tested the code by just using gotoAndPlay/gotoAndStop by itself in the first frame with no other code and it still wouldn't work as expected. Funny thing is, if I run the test withing Flash MX, it would work fine. If I run the flash by itself outside of Flash MX in the player, or run it within a web page, it wouldn't work.

    Any ideas? I'm stumped. Thanks in advance for your help.

Similar Threads

  1. Flash MX 2004 Links
    By incka in forum Graphics & Multimedia
    Replies: 5
    Last Post: 01-27-2004, 11:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •