Adobe flash CS5 - Zoom a part of a picture

87 Views Asked by At

I have a picture with the batch of numbered parts (about 50).

enter image description here Each part has a short text description.

When user presses Submit button, a particular part should be displayed in a label as well as its description.

What is the proper way to do this? Do I have to place each part on a separate layer? If yes, how can I make one particular layer be displayed and show its description as well?

1

There are 1 best solutions below

0
O.B On

How about rather than splitting the image you just zoom in and move the x and y coordinates of the image.

So start with a button listener then have:

//Image bigger on submit answer
Image.scaleX *= 4;
Image.scaleY *= 4;

//Switch to determine new position of image based on user input
switch(int(txtInputValue.text)){
    case 1:
        image.x = 720;
        image.y= 400;
        break;
    case 2:
        image.x = 1560;
        image.y = 100;
etc....

}

You'll have to test with the x and y values of the image to show exactly what you want, but I think this is easier than cutting the image up and having a massive library.

Also just an idea you could then add some scrolling to it.

Hope this helps