Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post

    How to interpret this AS2 script, please?

    Hello

    I have bought a Flash template and I am trying to break it down, so to speak, so that I am able to customise it. I have asked the vendor, but they want to charge me huge chunks of money for what I would call snippets of information.

    I have uploaded a screenshot of the file I would be grateful for help on.

    http://www11.brinkster.com/stevehigham/coding.html

    In the screenshot, next to Layer1 and Layer2 there are two small green icons (but they are not identical). What do they mean, please?

    Then, when I on a thumnail (symbol 136), I can see the following in my Action Script panel.

    onClipEvent(load) {
    _root.scrollY=this._y;
    _root.scrollN=1;
    }
    onClipEvent(enterFrame) {
    a=((_root.scrollN-1)*121+_root.scrollY);
    dx=a-this._y;
    if ((dx<1) and (dx>-1)) {
    dx=0;
    this._y=((_root.scrollN-1)*121+_root.scrollY);
    } else {
    this._y+=dx/4;
    }
    }


    What seems a little strange, is that although there is script in the Action Script panel, there is no little 'a' in the frame timeline.

    Anyway, what does the code mean, please? In the movie, when I click on a thumnail, it takes me to a larger image. Is this larger image (or its location) indicated in the script above?

    Many thanks.

    Steve

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    The actionscript has been applied directly onto the movieclip, and not on the frame. This means that it doesn't execute based on the timeline but rather on these onClipEvents (load or enterFrame which is deceptive).

    What it does is hard to say, but it is changing the location properties (_y) of scrollY and scrollN.

    If you double click on an item in the movie, if it has a subtimeline (like a movieclip) it will open up the timeline for just that item.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post
    Hello Jeremy

    Thank you for replying.

    I will try double clicking on an item (in the movie or fla file?) and see if it gives me a subtimeline. I have MX 2004, not sure if that makes a difference.

    What happens when I click on a thumbail in the movie is that it takes me to a larger image, so maybe the x and y etc in the script I posted, relate to resizing an image?

    The difficulty I have is that the same text is applied to all images (which slide), so I might have a photo of Mariyn Monroe next to a text on beauty creams, then I will click on a thumbnail of say, a picture of Mike Tyson. That takes me to a larger image of him, but accompanied by the same text on beauty creams!!

    Cheers again for posting.

    Steve

  • #4
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In the screenshot, next to Layer1 and Layer2 there are two small green icons (but they are not identical). What do they mean, please?
    Layer 2 is a "Mask" for Layer 1.


  •  

    Posting Permissions

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