A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: MX 2004(AS2)Error with actionscript in Flash puzzle

  1. #1
    High School Senior
    Join Date
    Jul 2005
    Location
    Olathe, KS
    Posts
    50

    MX 2004(AS2)Error with actionscript in Flash puzzle

    Statement must appear within on/onClipEvent handler varoffsety = 0
    I was trying to follow a tutorial by the book, which did not mention using any of the "on" commands
    the tutorial can be found here:
    as a .doc
    google cahced as HTML(no pics)

    Any suggestions?
    based off of the tutorial, should I use onClipEvent and then which code?

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    You get that error when you attach code to a button or movie clip.
    If you attach code to any of these objects, the code has to be inside an on() or an onClipEvent().

    If you attach code to a frame, it's the opposite: you can't used on() oronClipEvent().

    As you're using MX 2004, and AS20 you should attach all your code to the (main) timeline as this is the preferred way to code - it's a good practice which brings a lot of advantages.

  3. #3
    High School Senior
    Join Date
    Jul 2005
    Location
    Olathe, KS
    Posts
    50
    thanks for the help, but I was still having issues with this particular tutorial. Its for making an interactive jigsaw puzzle with flash. Wouldn't I need to attach the specific code to the specific piece, or in the fram code is there a way to assign certain sections of code to a piece without it being on the piece. (The pieces are named piece1, piece2, piece3...and so on through piece30. (Going left to right)

  4. #4
    Senile member! :)
    Join Date
    Dec 2001
    Location
    Saunaswamp (transl)
    Posts
    2,296
    What the author means is that you are supposed to put the script on the first frame of the movieclips timeline(Doubleclick the movieclip on stage to get to it's timeline). I know this isn't "good practice" but thats what he/she means.

    /Mirandir

  5. #5
    High School Senior
    Join Date
    Jul 2005
    Location
    Olathe, KS
    Posts
    50
    Quote Originally Posted by Mirandir
    What the author means is that you are supposed to put the script on the first frame of the movieclips timeline(Doubleclick the movieclip on stage to get to it's timeline). I know this isn't "good practice" but thats what he/she means.

    /Mirandir
    Thanks, I'll try the tip.

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