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 3 of 3

Thread: Image swapping

  1. #1
    Regular Coder cyrus709's Avatar
    Join Date
    Dec 2008
    Posts
    102
    Thanks
    22
    Thanked 5 Times in 5 Posts

    Image swapping

    I am trying to make an image that when you click in a specific spot of it, it changes the image.
    An example would be i have a brown image, and when you click on it the image turns into another image, such as a green image, then it keeps going until the last one you cant click on it, and it says "the end".

    Right now my thought is that i should use a button? I made it so that you can click in a specific spot (say the middle) and it changes the image, but when i let the mouse button up, the image returns to how it was. I want the image to take the place, or to be a new image where i can continue clicking? does this make since?
    Im new to flash and action script, and am used to php. If anyone could help me i would appreciate it. or at least lead me in the right direction? I have flash cs4
    Last night I lay in bed looking up at the stars in the sky and I thought to myself, where the heck is the ceiling.

  • #2
    Regular Coder cyrus709's Avatar
    Join Date
    Dec 2008
    Posts
    102
    Thanks
    22
    Thanked 5 Times in 5 Posts
    Sorry but im 100% new to Flash, the scripting i could get by with, its learning how to use flash that im still grasping.

    This is exactly what im trying to do. http://www.albinoblacksheep.com/flash/basicinteractive, They have it so that you can click on a button ( or a link) and it continues to another page? That is what i would like to be able to do! IF anyone could help me, or even redirect me i would be very great full.

    All i need is for it to go from one page to the next, like where in that tutorial where you hit the link, or triangular button
    Last night I lay in bed looking up at the stars in the sky and I thought to myself, where the heck is the ceiling.

  • #3
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Well there are different techniques, and I really only know the Actionscript 2 versions well enough. However you may consider version 3 if you are going to do serious flash work.

    So I would suggest that you take a look at this for one method.

    http://www.kirupa.com/developer/mx2004/jump_frames.htm

    Another method would be to swap the source of the image itself, rather than just moving frames. This is preferred when you want other elements on the stage to stay put.

    You would need to use the mouse event handlers to detect a mouse click, and then use the loader to change the source of the movieClip. Many of these elements are covered here.

    http://www.kirupa.com/developer/mx20..._slideshow.htm
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.


  •  

    Posting Permissions

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