Zoom on image when you click on

Hello.  I have an image that I converted to a movieclip.  I have added a click event to it, and when you click on it, I'm trying to zoom in on the image to the point that it has been activated.  I tried a few following code but ended up in trouble.

var scaleFactor:Number = 0.8;

var minScale:Number = 0.25;

var maxScale:Number = 2.0;

men.addEventListener(MouseEvent.CLICK, menOver);


function menOver(e:Event)
{

    var mat:Matrix;
    var externalCenter:Point = new Point(men.mouseX,men.mouseY);
    var internalCenter:Point = new Point(men.mouseX,men.mouseY);

    men.scaleX = Math.max(scaleFactor*men.scaleX, minScale);

    men.scaleY = Math.max(scaleFactor*men.scaleY, minScale);
    mat = men.transform.matrix.clone();
    MatrixTransformer.matchInternalPointWithExternal(mat,internalCenter,externalCenter);

    men.transform.matrix = mat;
}

For now, it is not automatically zoom in (you will need to keep clicking on).  Also, he is currently zooming.  Not sure where I'm wrong.

The effect I'm after is really, like a pan of the camera and the zoom.

Any advise appreciated.

For now, it is not automatically zoom in (you will need to keep clicking on).

If you want to get an animation effect, you have to keep calling the lines where you recalculate the balance in a few for example, timer or repeting function enterFrameHandler of.

Also, he is currently zooming.

You calculate new minScale, which is smaller than 1, property ladder so: zoom out.

Try this code. I hope that it compiles - I wrote it in Notepad.

The basic idea is to call the repetedly function that sets the scale. The repeting function starts when you press the mouse down on your movieclip and stops when the scale is almost the same as targetScale. When you release the mouse button, it should animate scale = 1.

Let me know if this helped.

var scaleFactor:Number = 0.8;
var minScale:Number = 1;
var maxScale:Number = 2.0;
var targetScale:Number;

men.addEventListener(MouseEvent.MOUSE_DOWN, men_mouseDownHandler);

function men_mouseDownHandler(event:MouseEvent):void {
    targetScale = maxScale;
    addEventListener(Event.ENTER_FRAME, enterFrameHandler);
    stage.addEventListener(MouseEvent.MOUSE_UP, stage_mouseUpHandler);
}

function stage_mouseUpHandler(event:MouseEvent):void {
    stage.removeEventListener(MouseEvent.MOUSE_UP, stage_mouseUpHandler);
    targetScale = minScale;
    addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}

function enterFrameHandler(event:Event):void {
    var mat:Matrix;

    var externalCenter:Point = new Point(men.mouseX, men.mouseY);
    var internalCenter:Point = new Point(men.mouseX, men.mouseY);

    if(Math.abs(men.scaleX - targetScale) > 0.05) {
        men.scaleX = men.scaleY = scaleFactor * scaleX + (1 - scaleFactor) * targetScale;
    }
    else {
        men.scaleX = men.scaleY = targetScale;
        removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
    }

    mat = men.transform.matrix.clone();
    MatrixTransformer.matchInternalPointWithExternal(mat,internalCenter,externalCenter);

    men.transform.matrix = mat;
}

Tags: Adobe Animate

Similar Questions

  • How to open an image when you click in a Word.

    Im working in a demo for an interactive book for ipad with the Digital Publishing Suite > Folio Builder and I need to be able to open a specific image when you click in a Word. I have not found a tutorial which shows how to do this can point me to it someone in the right direction please?  THX so much

    Simply put a box above the word. Then convert the box to a button with the action "go State" that points to a specific State in MSO with your image. While an invisible button (no fill and no stroke). Probably the ASM must be first vacuum State.

  • Tips for the HTML and CSS code enlarge an image when you click on it?

    Hello

    When you click on an image of an inch that I want users to be able to display a version grown in the same Web page, and then click close to return to thumb image.

    Is not in a gallery is a sales page that contains 3 images.

    I'm new to this - learning all the time any help greatly appreciated!

    Kind regards, Matt.

    PS code used so far;

    "< img src="images/gallery_images/thumbs/120px-Glass_1.jpg "alt =" glass image 1 "width ="150"/ >

    Add class = 'fancybox' to your ankles.

    class = "fancybox" href = "images/gallery_images/large_images/700px-Glass_1.jpg" >images/gallery_images/thumbs/120px-Glass_1.jpg "alt ="description">

    Nancy O.

  • Show/hide elements - how to hide an image when you click on another

    I have a page of the library of photo with 10 pictures on it. I organized it where there is a large image on the left side of the page and 10 thumbnails of turning on the right. I put larger images in separate AP div tags hidden. I want the big picture is displayed when the user clicks on the corresponding thumbnail. This works well, but how to make the image of 'hide' when the user clicks on a different thumbnail.

    Can you help me?

    Here is my code:

    < div id = 'eau1"style =" position: absolute; " Left: 20px; top: 50px; Width: 630px; height: 491px; z-index: 100; visibility: hidden; "" "> < img src ="... / media/images/water/water1.jpg "width ="650"height ="500"alt ="eau1"> < / div >
    < div id = "water2" style = "position: absolute;" Left: 20px; top: 50px; Width: 630px; height: 491px; z index: 103; visibility: hidden; "" "> < img src ="... / media/images/water/water2.jpg "width ="650"height ="500"alt ="water2"> < / div >
    < table width = "100%" border = "0" cellspacing = "0" cellpadding = "0" >
    < b >
    < td width = "20" height = "20" > < table >
    < td > < table >
    < td > < table >
    < td > < table >
    < td width = "20" > < table >
    < /tr >
    < b >
    < height td = "20" > < table >
    < height td = '30' class = "copy18grey" > water Applications < table >
    < td > < table >
    < td > < table >
    < td > < table >
    < /tr >
    < b >
    < td > < table >
    "" < td width = "650" height = "500" rowspan = "5" valign = "top" > < img src = "... / media/images/water/water1.jpg" width = "650" height = "500" alt = 'eau1' > < table >
    "" < td = '100' height > < a href = "#" onMouseOver = "MM_swapImage ('Image12 '", '... / media/images/water/water1_thmb_over.jpg',1) "Mm_swapimgrestore" > < img src = "... / media/images/water/water1_thmb.jpg" name = 'Image12' width = "160" height = "100" border = "0" onClick = "MM_showHideLayers ('eau1',", 'show') ' onDblClick = "MM_showHideLayers ('eau1',", 'hide') "" > < /a > < table > "
    "" < td > < img src = "... / media/images/test.jpg" alt = "" width = "160" height = "100" > < table > "
    < td > < table >
    < /tr >
    < b >
    < td > < table >
    "" < td = '100' height > < a href = "#" onMouseOver = "MM_swapImage ('Image13 '", '... / media/images/water/water2_thmb_over.jpg',1) "Mm_swapimgrestore" > < img src = "... / media/images/water/water2_thmb.jpg" name = "Image13" width = "160" height = "100" border = "0" onClick = "MM_showHideLayers ('water2',", 'show') ' onDblClick = "MM_showHideLayers ('water2',", 'hide') "" > < /a > < table > "
    "" < td > < img src = "... / media/images/test.jpg" alt = "" width = "160" height = "100" > < table > "
    < td > < table >
    < /tr >
    < b >
    < td > < table >
    "" < td = '100' height > < img src = "... / media/images/test.jpg" alt = "" width = "160" height = "100" > < table > "
    "" < td > < img src = "... / media/images/test.jpg" alt = "" width = "160" height = "100" > < table > "
    < td > < table >
    < /tr >
    < b >
    < td > < table >
    "" < td = '100' height > < img src = "... / media/images/test.jpg" alt = "" width = "160" height = "100" > < table > "
    "" < td > < img src = "... / media/images/test.jpg" alt = "" width = "160" height = "100" > < table > "
    < td > < table >
    < /tr >
    < b >
    < td > < table >
    "" < td = '100' height > < img src = "... / media/images/test.jpg" alt = "" width = "160" height = "100" > < table > "
    "" < td > < img src = "... / media/images/test.jpg" alt = "" width = "160" height = "100" > < table > "
    < td > < table >
    < /tr >
    < b >
    < td > < table >
    < td > < table >
    < td > < table >
    < td > < table >
    < td > < table >
    < /tr >
    < /table >

    Show/hide behavior is not just for a single element.  With a single application of the behavior, you can display an image and 24 other people hide.  The trick is to keep by selecting the named items and their visibility, that is, to select "img1" and click display, then select "img2" and click Hide, etc.

  • Someone at - it an easy way to hide an image when you click on it?

    Hello

    I have an image where I need each arrow/box text to remove once clicked. There must be an easier way to create millions of images? Is it possible to do it with a button? The person using the animation should click on vouchers that would lead to their dissappearing.

    It was fun place in photoshop. That the picture will be brought in the library of hot flashes.

    Thanks in advance.

    A17L01P120.jpg

    F8 to convert the image into a symbol

    give a name to the new video clip (perhaps image1)

    then add the code in the framework (F9)

    Image1. addEventListener (MouseEvent.CLICK, hideImages)

    function hideImages(e:MouseEvent):void {}

    e.Target.Visible = false;

    }

    for other images just add a line of image

    Image2. addEventListener (MouseEvent.CLICK, hideImages)

    image3. addEventListener (MouseEvent.CLICK, hideImages)

    image4. addEventListener (MouseEvent.CLICK, hideImages)

  • I have a small black square box that suddenly appeared on my iPad screen and I can't get rid of it. It is said to perform a zoom, zoom full screen, etc. When you click on it. I have to remove my screen; It drives me crazy.

    I have a small black square that has all of a sudden shiown on my iPad screen and I can't get rid of it. When you click on it, it is said, perform a zoom, zoom full screen, etc. I need because it drives me crazy.

    Help!

    You have one of the accessibility features enabled. Go to settings > General > accessibility and Zoom 'off' (the icon you see is the 'Show' controller on screen Zoom settings) - and check what accessibility shortcuts (a triple-click of the home button) is defined in the lower part of the screen for accessibility

  • What kind of image is in a document. INDD so when the file is opened you get the message 'document contains 6 links to sources that are missing' and when you click OK to recreate a link to missing files, the document opens with the images?

    What kind of image is in a document. INDD so when the file is opened you get the message 'document contains 6 links to sources that are missing' and when you click OK to recreate a link to missing files, the document opens with the images? Missing images are not on my computer, but when the document opens the images are there. I can copy and paste the INDD images in Illustrator. Y files/images/I am able to copy and paste the images that have been incorporated into the INDD file in AI of the INDD file? If this is not what type of image am I copy and paste? Can I take the images that I stuck in there and place them in a new INDD document and have the images to reproduce without problems?

    The images could be anything - check the links Panel.

    What you see (and copy) is just the screen preview, not the actual image data.

  • How to integrate an audio to a Muse image file so that the music plays only when you click on the image?

    Hello! I'm looking for a way to incorporate an audio file (mp3 or quicktime) into a still image in my Muse site. Ideally, the audio would play only when you click the image, so that each image can contain a separate audio file. So important is that the audio file is not visible on the site (so soundcloud, youtube and vimeo doesn't work here). Is there a way to do this? Thank you, AR

    Check out this edition of the month of 123Muse (www.123Muse.com). This is audio and video by Muse.

  • Hello, I created an application of DPS, and I want that when you click on an image, it opens a pdf file. But this one is on the ipad.  This is where there is no internet connection.   Thank you.

    Hello

    I created an application of DPS, and I want that when you click on an image, it opens a pdf file. But this one is on the ipad.

    This is where there is no internet connection.

    Thank you.

    Put the PDF file in a file HTMLResources.zip.

  • How to make an image on a scroll bar navigate to home, contact, etc. - page when you click it?

    IM building a site that I created the contact mode, House, etc. pages already. I also did an image for the homepage slider but I want to access a picture when you click on it to access the home page, but I can't seem to understand. I'm using flash cs4. I want to make a shortcut to different pages on the website

    One way you can do is make the code you showed generic and place it in the main timeline on a layer that spans the length of the timeline where this image clipping will be.

    Have your btnHome work (renamed to be btn below) for all options menu by making it an invisible button that covers the part of the image of the image styll.  Then use a variable for the gotoAndPlay ("selectedPage" below) argument which you reassign in each frame of the scrolling of the image.

    main timeline

    var selectedPage:String = 'Home';  what the starting value must be

    function goToPage(evt:Event):void {}

    gotoAndStop (selectedPage);

    }

    btn.addEventListener (MouseEvent.CLICK, GoToPage);

    Then, inside yor image scroller in each image, you set a new value for the variable selectedPage.

    For example, in the frame 2 you put:

    MovieClip (parent) .selectedPage = "music";

    in part 3 you put:

    MovieClip (parent) .selectedPage = "artist";

    and so on

  • Small box, Adobe Flash Settings for storage space interferes with videos. It won't go away when you click DECLINE. Windows 7

    This little box pop up asking the storage space appears constantly during the videos, and it won't go away when you click DECLINE.  I tried to DENY EVERYTHING in the settings, but then I couldn't videos, even videos that play, but are covered by the small box of Adobe, asking for storage.  I just never will have access to the videos without the interference of Adobe?

    Hello

    The application that you are running in Adobe Flash Player wants to store some information on your computer, but it needs more space than is currently allocated. Player, Flash displays the amount of space that is currently used for storage and pray the required maximum to save the information.

    You can use the Save Local settings panel to let future applications of this Web site to store information on your computer without asking you for permission each time. To display the Local Storage Panel:

    a. right click on the image for application during its execution.

    b. in the context menu, select settings and then click the Local Storage tab.

    You can also use the Flash Player Settings Manager to manage your settings of local storage at the global level and on a site-by-site basis.

    1. what application you run using Adobe Flash Player?

    2. you are trying to play the videos from the computer or online?

    3. what web browser do you use on your computer?

    Follow the steps below:

    Method 1:

    In the Settings of Adobe Flash Playerpop-up message, check the box never ask again, click allow and control.

    For reference:

    http://www.Macromedia.com/support/documentation/en/flashplayer/help/help07.html#117290

    Method 2:

    Uninstall Adobe Flash Player and reinstall the latest version and check.

    Uninstall or change a program:

    http://Windows.Microsoft.com/en-us/Windows7/uninstall-or-change-a-program

    Install the latest version of Adobe Flash Player from the link below:

    Adobe Flash Player:

    http://get.Adobe.com/flashplayer/

    Method 3:

    If you are facing problems in Internet Explorer, and then follow the steps in the link below.

    The video problems when you use Internet Explorer:

    http://support.Microsoft.com/kb/2532294

    Warning: Reset the Internet Explorer settings can reset security settings or privacy settings that you have added to the list of Trusted Sites. Reset the Internet Explorer settings can also reset parental control settings. We recommend that you note these sites before you use the reset Internet Explorer settings.

    Note: The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

    For reference:

    Of local storage pop-up question:

    http://www.Macromedia.com/support/documentation/en/flashplayer/help/help06.html

    Let us know the status of the issue. If you need help, please after return. We will be happy to help you.

  • an error "file does not have a program associated with it for performing this action" when you click office and recent places.

    Original title:

    Win7 victory explrer click dsktop & mployment plces & get eror msg file is not a CDSA wth to prfrmin ths field prgrm. pls instl one prgrm so is alrdy instld Credit Union assc ltvds cntrl pnl prgrms

    I don't know how to fix. Help, please.    Win7 windows Explorer click

    Office & recent locations & grterror msg:
    This file does not have a program associated with it for performing this action. Please install a program or, if it is already installed. create an asssociationin the default programs control panel.
     
    Information given in the new thread:
    Error Msg When you try open office spaces & recent since the win Explorer

    when im in windows Explorer and click on the desktop or the recent places the link I get a msg of error and they will not open, but all others open. I posted pictures of error msg to skydrive yesterday.

    Hello

    Welcome to the Microsoft Community Forums.

    I see you've found an error "file does not have a program associated with it for performing this action" when you click office and recent places.

    1. Have you made changes on the computer before this problem?
    2. What is the full error message?

    I suggest you to report to us the screenshot of the Advanced window so that we can understand what exactly the situation.

    See:
    Use SkyDrive download collected files and post screen shot/image
    http://social.technet.Microsoft.com/forums/en-us/w7itproui/thread/4fc10639-02dB-4665-993a-08d865088d65

    The average while you can try the following steps and check if the error reappears.

    Method 1:

    Step 1:

    Start the computer in safe mode and check the number.

    Some options, including the mode safe mode, start Windows in a limited State, where only the essential is started. If a problem doesn't reappear when you start in safe mode, you can eliminate the default settings and basic device drivers and services as a possible cause.

    Follow this link provided below to start your computer in safe mode.

    http://Windows.Microsoft.com/en-us/Windows7/advanced-startup-options-including-safe-mode

    Step 2:

    Put the computer to boot and check if the problem persists.

    To help resolve the error and other messages, you can start Windows 7 by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/kb/929135

    Note: After troubleshooting, be sure to set the computer to start as usual as mentioned in step 3 of the KB article provided above.

    Method 2: I also suggest that you scan your computer with the Microsoft Security Scanner, which would help us to get rid of viruses, spyware and other malicious software.

    The Microsoft Security Scanner is a downloadable security tool for free which allows analysis at the application and helps remove viruses, spyware and other malware. It works with your current antivirus software.

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Note: The Microsoft Safety Scanner ends 10 days after being downloaded. To restart a scan with the latest definitions of anti-malware, download and run the Microsoft Safety Scanner again.

    Important: During the scan of the hard drive if bad sectors are found, the scanner tries to repair this sector, all available on which data may be lost.

    It will be useful.

    Back with the details so that we can help you further. We also indicate the result of the suggested steps.

  • I found no function 'Receive a file' when you click on Bluetooth icon bar tasks

    Good day everyone,
    I use Windows 8 64 bit on Asus N56VZ-S4324H language
    I have not found the function 'Receive a file' when you click on Bluetooth icon bar tasks,

    So I don't know how to transfer my files from my phone to my laptop.
    I'm trying to fix the error of re - install the Bluetooth driver, but not solve this problem.
    Please help me!

    It's my screen image:
    Thank you all for your help!

    I fixed my problem on bluetooth transfer.


    When I waited longer that normal, I see windows pop up appears on the taskbar.
    Now I transferred files through bluetooth.
    Thank you once again!

    MenPro Admin
  • How to enlarge the parts of a circle of get - have text pops up when you click on it?

    I'm working on an interactive infographic in edge animate CC. I use pieces of a circle and when you click on / hovered, I want the pieces to grow and also have the text pop up on the side. I am struggling with how to animate my circle pieces so that they move and are clickable. Can someone offers directions?

    I made a sample for you, but not using EC.  This used boxes, images and a text field which is change according to the box that is clicked. I hope this helps.

    PNG and info.zip - Box

  • Instagram widget for Muse - wrong instagram when you click on it!

    I see Snap Widget and Qoo Qee have widgets free Instagram and I the last work in my site.

    Only problem, is that when you click on one of the images in the feed, the user is sent to a version Qoo Qee Instagram account? It looks like a fake account Instagram!

    My client not want their customers to wear their real Instagram account the same as Facebook and Twitter, which have both work perfectly.

    How can this be achieved please?

    Thank you

    You can get a faster response, contact the developer of the widget itself rather than here. But if I had to guess there is probably a place in the properties of the widget to get into the details of the account Instagram.

Maybe you are looking for