Panning image script

Hello all,
I am writting a new post about the same issue, sorry for that, but i really need help,
Finally, i am using the following code for panning a big image in my flash as3 project :
function panThisImage(target:MovieClip, speed:Number,speed1:Number, dir:int) {
var mousePercent:Number = mouseX / stage.stageWidth;
var mousePercent1:Number = mouseY / stage.stageHeight;
stage.addEventListener(MouseEvent.MOUSE_DOWN, panImage);
target.cacheAsBitmap = true;
function panImage(E:MouseEvent):void {
var mSpeed:Number;
var mSpeed1:Number;
mousePercent = mouseX / stage.stageWidth;
mousePercent1 = mouseY / stage.stageHeight;
if (dir == 1) {
mSpeed =1-mousePercent;
} else {
mSpeed =mousePercent;
if (dir==1) {
mSpeed1 =1-mousePercent1;
} else {
mSpeed1=mousePercent1;
target.destX = Math.round(-((target.width-stage.stageWidth) * mSpeed));
target.destY = Math.round(-((target.height-stage.stageHeight) * mSpeed1));
if (target.hasEventListener(Event.ENTER_FRAME)) {
target.removeEventListener(Event.ENTER_FRAME, del);
target.addEventListener(Event.ENTER_FRAME, del);
function del(E:Event):void {
if (Math.abs(target.x-target.destX) <= 1) {
target.x = Math.round(target.destX);
target.removeEventListener(Event.ENTER_FRAME, arguments.callee);
} else {
target.x += (target.destX-target.x) * (speed / 100);
if (Math.abs(target.y-target.destY) <= 1) {
target.y = Math.round(target.destY);
target.removeEventListener(Event.ENTER_FRAME, arguments.callee);
} else {
target.y += (target.destY-target.y) * (speed1 / 100);
     //tumpanel.y = imgLoader.y  + 405;
     //tumpanel.x = imgLoader.x  + 135;
panThisImage(imgLoader,1,1,2);
The big image (imgLoader) moves with the coordinate of the mouse. But finally, i want it to move when i press and drag imgLoader. Not by mouse move.
Can i change the code above?
Thanks for help

If you only want to drag the object, then you can get rid of all that code and just look into using the startDrag() and stopDrag() methods.
imgLoader.addEventListener(MouseEvent.MOUSE_DOWN, dragImgLoader);
imgLoader.addEventListener(MouseEvent.MOUSE_UP, releaseImgLoader);
function dragImgLoader(evt:MouseEvent):void {
    imgLoader.startDrag();
function releaseImgLoader(evt:MouseEvent):void {
    imgLoader.stopDrag();

Similar Messages

  • Help with panning image

    Hi There
    I'm building a site that features a panning panoramic image with buttons embedded into it. I've got a piece of script that does it for me, but I have two issues.
    1. My panning image is 500 pixels high and my document is 700px, right now the pan effect works anywhere, but I'd like to limit it to work only when the cursor is over the image (500px in the centre with 100px of white at the top and bottom). So basicly need some sort of 'if' variable for y axis...
    2. Also would like to know if it is possible to stop the pan if the cursor moves away from the image area. Right now if you are panning sideways and you move the mouse out, it will keep panning untill it reaches the end of the image.
    Script that I'm using:
    _global.plotis = Stage.width;
    centre._x = _global.plotis / 2;
    speed = 40;
    full._y = 50;
    this.onMouseMove=function(){
    delete this.onMouseMove;
    this.onEnterFrame = function(){  
        if(_xmouse<150 || _xmouse>750){
        var A:Boolean = false;
        var X = _xmouse - _global.plotis / 2;
        full._x += -X / speed;
        if (full._x >= 0) {
            full._x = 0;
        if (full._x <= -(full._width - _global.plotis)) {
            full._x = -(full._width - _global.plotis);
    thanks a lot,
    Spawn NZ

    You should be able to include those limits in the conditional you already have...
    if(_xmouse<150 || _xmouse>750){
    maybe something like...
    if(((_xmouse > 1 && _xmouse<150) || (_xmouse>750 && _xmouse < 900)) && (_ymouse > 100 && _ymouse<6000)){

  • Audio problems with panning image

    Hello, I am a relatively new user of flash and had a few
    questions. I am building a panning image within flash, then
    exporting the swf file and creating a new swf file using a plugin.
    The problem I am having is within my first created swf, I am
    creating invisible buttons around the image for people to click on.
    When they click on these "hotspots" they hear audio relating to
    this area. However, the issue I am having is with audio overlap. If
    they click the hotspot more than once, the audio will begin playing
    and major overlap occurs, also if they click more than one hotspot
    at a time, this overlap occurs as well. Right now, there is a audio
    clip at the beginning and the only hotspot that is working is the
    notebook under the person in the picture. Is there a way to include
    in the action script coding something that will stop other audio
    once one clip is clicked? I have included a link to the fla so you
    can take a look.
    Panning
    Image with Hotspots
    Any advice would be greatly appreciated!
    Thanks

    sorry dude I wouldnt be able to give example in actionscript
    2.0 cos I'm currently playing with actionscript 3.0 and its got me
    thinking about it all in a slightly different way.
    I think in actionscript 2.0 you can buttons store the
    actionscript in them, where as you cant do this in actionscript 3.0
    you can't you have to have actions on a frame and then add
    listeners to the buttons.
    If you can do this in actionscript three you'll have
    something similar to
    var isPlaying : Boolean = false;
    _root.notepade_btn.on(release)
    if(isPlaying == false)
    // *Add code to play noise* //
    isPlaying = true;
    else
    // You can add code to re-start noise or just stop it or
    anything you choose is best
    I know this probably wont work but I hope it can't gives you
    somewhere to aim towards
    Gaunt

  • Importing Subtitles using Image Script

    I'm just about to make a project with seven different languages. It will have audio tracks as well as subtitle tracks.
    I've done subtitles in Encore 1.5 before using text with some success. For this production I need to import tif using an image script. I can get the script working, however once it's located the images to import it gives me an error message along the lines of
    "Sorry, an abnormal condition has been detected. Before quitting, you have one chance to save your project..."
    Note I get passed the Map Colours and Import Subtitles dialogue box. It is only when I click on this last stage that it goes bad.
    Any ideas. I kinda thought this was what the program was meant to do.
    - Geoff

    Turns out the problem I was having was due to memory. Needed to restart.
    Naartjie, not sure how to save subtitles with a background image. Encore seems to only want to work with three colours, one is the background colour, the colour of the text and the colour of the outline for the text. So unless you can make your background image from the two colours that remain on the screen - text colour and outline, I'm not sure how to do go about it.
    - Geoff

  • Where is the Pan Image filter

    I need to use the Pan Image Effect on a great set of still images and can't find the Pan Image filter. I should have been able to find it under video transforms folder on the Effects Palette.

    I was able to make the pan effect work. It is really poor when compared to stage tools.
    1) the image pixelation is rediculous
    2) the finished result is worse than  rediculous
    3) I took the stage tools and did a horizontal pan at the bottom of the image that would be equalent to about isa small strip along the botton 8000x6200 image at about a scale of600 during the entire process the entire full resolution image was on screen and the little frame moved across the image and the pop up monitor that was provided by stage tools showed the actual path of the frame across that full size image (30" monitor) so you not only saw it in high resolution but it was extremely easy to track especially when following a non irregular line down a winding canyon or river.
    the reason that the stage tools client list reads like the who's who's of motion picture industry is because it's about 100 times better than using the motion effect built into Adobe.
    http://www.videofame.com/VideoProductions/Client_List_Broadcast.mht
    did you really think that Lucas Films would have been one of the largest users of this plugin if Adobe had the panning capability this does.
    You guys are like trying to think that anything you can't do Adobe directly is silly. Give it a break. I love Adobe I own I think the fact that they encourage outside vendors to create great plugins for Adobe users is brilliant. some how I think you guys have missed the point. Adobe can't even compare with stage tools for panning and zooming. like a difference between a VW bug and a F1 Ferrari it's just rediculous. But don't take my word for it download the stage tools for free like I did and try it. You just won't believe the difference. You need to start with a super quality image though from the Hasselblad website downloads area you should be able to download some 50 or 60 MB files that are like the dimensions shown below:
    http://www.hasselbladusa.com/products/h-system/h4d-60.aspx
    Sensor size: Dalsa 60.1 Mpixels (8956 x 6708 pixels)
    Sensor dimensions: 40.2 mm x 53.7 mm
    Image size: RAW 3FR capture 80 MB on average. TIFF 8 bit: 180 MB
    Where talking Lucas film quality now not 35mm Rebel or D30's

  • Image script doesn't use the correct host name

    Hello NG
    I created a ZCM Imaging script so that I got a prompt for the name of the
    workstation. Unfortunatelly the script doesn't work correct. I set as WSName
    following Name WS999
    After the Image was restored, the hostname was set to Company-SJCFNSG
    (example: Company = Novell) NOVELL-SJCFNSG
    What could be the cause of this problem?
    Here the script i used:
    IMGSVR=192.168.4.30
    while test ! $WSNAME; do
    echo -n -e "\n Please set NetBIOS Name and a accept with Enter: ";
    read WSNAME;
    done;
    if test $WSNAME; then
    zisedit Name=$WSNAME;
    fi
    img -rp MyImage1.zmg
    img -rp MyAddOn1.zmg
    img -rp MyAddOn2.zmg
    sleep 10
    Regards
    Ramon

    I did find the solution!
    In earlier Zenworks versions the wsname was set by "zisedit name=PCName01"
    now in ZCM10 and ZCM11 the variable did change so I had to modify it to
    zisedit Computername=PCName01
    if test $WSNAME; then
    zisedit ComputerName=$WSNAME;
    fi
    Regards
    Ramon
    "Ramon Lustrati" schrieb im Newsbeitrag
    news:C%zup.26$C%[email protected]..
    Hello NG
    I created a ZCM Imaging script so that I got a prompt for the name of the
    workstation. Unfortunatelly the script doesn't work correct. I set as WSName
    following Name WS999
    After the Image was restored, the hostname was set to Company-SJCFNSG
    (example: Company = Novell) NOVELL-SJCFNSG
    What could be the cause of this problem?
    Here the script i used:
    IMGSVR=192.168.4.30
    while test ! $WSNAME; do
    echo -n -e "\n Please set NetBIOS Name and a accept with Enter: ";
    read WSNAME;
    done;
    if test $WSNAME; then
    zisedit Name=$WSNAME;
    fi
    img -rp MyImage1.zmg
    img -rp MyAddOn1.zmg
    img -rp MyAddOn2.zmg
    sleep 10
    Regards
    Ramon

  • Problems applying preboot imaging script bundle w/ 11.3.2

    Hi all,
    Just wondering if its just me with these issues.
    I had our preboot imaging script bundle assigned to the Workstation folder within the ZCC, but since the update to 11.3.2 when attempting to apply the imaging script bundle to a device within the ZCC it throws an error saying that no imaging script bundle is assigned to the device. The only way to get around this issue has been for me to assign the preboot imaging script bundle to each device within our zone, not the folders they exist within.
    Another issue I've had is if I select more than one device within the ZCC the action option "apply assigned imaging bundle" is greyed out. If I only select one device I am able to use that option again.
    Can anyone else confirm if they're experiencing the same issues?
    We're running 3x SLES 11 primaries running 11.3.2, all with the imaging role (our imaging script load balances between the three).
    I've tried accessing the ZCC with Internet Explorer, Firefox and Chrome and they all experience the same issue above.
    Regards,
    Matt

    Originally Posted by Thomas Degenhardt
    Am 17.12.2014 um 02:16 schrieb xvastx:
    >
    > Hi all,
    >
    > Just wondering if its just me with these issues.
    >
    Hello Matt,
    we are having the same issues. Did you contact Novell and opened a SR?
    Regards,
    Thomas
    Hey Thomas,
    We're on an educational licence so, unfortunately, we don't have any SRs to play with. Hopefully Anders has sent the issue trough to Novell.
    Regards,
    Matt

  • Suggestions for simple random image script

    Would like to randomly display one of five new JPG banner each time page is loaded.
    Your experience would be appreciated.
    Thanks

    Since no one replied, I am posting solution I found.for future inquiries.
    Simple PHP Random Image Script
    This can be done in one line of text directly in your HTML and a collection of images.
    The first step is to gather together the images you wish to have randomly rotated.
    Change all of their file names to a numerical order, starting with the number 1.
        * 1.jpg
        * 2.jpg
        * 3.jpg
        * 4.jpg
    Be sure each image has the same extension (either all jpg, png, or gif),
    and that there are no gaps in the numbers.
    Also, place these images in their own folder to keep everything organized.
    Write the Code
    In the HTML of your page, insert the following code where you want an image to display:
    <img src="path/<?php echo rand(1,n);?>.jpg" alt="Random Image" />
    The “rand” operator will display a randomly generated number between 1 and ‘n’.
    Change ‘n’ to the total amount of pictures you have arranged numerically
    (or the highest numbered picture you have).
    In the example above I only have 4 pictures, therefor I would change it to: rand(1,4);

  • How do you pan images on Adobe Pro? Please help

    I am having great difficulty panning images.

    Google the following for many tutorials - adobe premiere pro ken burns effect
    Jeff

  • Resize Images script

    Dear all,
    Here is my new Resize Images script for everybody who wants it:
    http://www.kasyan.ho.com.ua/resize.html
    Any feedback is welcome.
    Kasyan

    I really don't know anythign about scripting but I remember that it is important to put the script in the following folder structure:
    Scripts-Scripts Panel-Version 4.0 Scripts
    I hope that will do it.
    From: [email protected]
    To: [email protected]
    Subject: Re: InDesign CS3 resize images 100% script
    Date: Fri, 11 Apr 2008 02:27:58 -0700
    A new message was posted by Chadi SAROUFIM in
    InDesign Scripting --
      InDesign CS3 resize images 100% script
    I have copied the above script and I am receiving the below error message. I would really appreciate if someone send the final working script since it is very usefull
    Error 25
    Error in line 2
    View/reply at
    InDesign CS3 resize images 100% script
    Replies by email are OK.
    Use the
    unsubscribe form to cancel your email subscription.
    More immediate than e-mail?
    Get instant access with Windows Live Messenger.

  • Panning Images in Edit Mode?

    I've used iPhoto 4 & 5, and noticed that this useful function in the former was missing in the latter. In version 4, by holding the Cmd/ key, I could use the crosshair to pan across and up and down an enlarged image, which was very useful when editing images at full resolution.
    I tried to do the same thing in version 5 and instead called up the adjustment panel. Had no luck with any other key combination, so I guess it has been made obsolete.
    Even with the capability of editing in full-screen mode for iPhoto 6, not everyone has a gigantic screen that allows viewing of images at full resolution.
    So my question to those using the latest version is, when you choose to view an image in edit mode, and enlarge it, can you pan around in it? Move up and down and across and around to another section of the image without using the irritating scroll bars or having to zoom out?
    I also find it counter-intuitive that there is no way to view an image at full resolution easily in iPhoto. They should add a button to do that, next to the enlargement slider.
    Hopefully someone can answer my queries soon. Thanks!
    PowerMac G4 1.25GHz Dual Processor MDD   Mac OS X (10.3.9)  

    Hi Zaihan,
    Take a look at this page and you will see you can do full-screen edits (not the same as a button for full resolution though)
    http://docs.info.apple.com/article.html?path=iPhoto/6.0/en/hlp253.html
    If you move the slider to the right to enlarge the photo, you will get a little navigation window that you can move the photo around in. It's very handy.

  • Pan image and simultaneous track motion

    I have a still photo that I am panning. At the same time, I want the still to move to a different (and smaller) position on the screen.
    Is there a way to apply a motion path to the video track which is independent of the motion being used on the still?

    Double-click the clip and load it into the viewer. Set a keyframe for both "scale" and "center" at the beginning of the clip. Set the scale to your liking as well as the position (in the canvas using "image + wireframe"). Go to the end of the clip (still loaded into the viewer) and set a "scale" and "center" keyframe. Change the scale to your liking. Then go back to the canvas and position the clip where you want it to end up. Make sure the "center" and "scale" keyframes are lined up on both ends.
    That what you were looking for?
    Jonathan

  • Pan image

    ok i think what im loking for is some type of pan. What i mean is my projects runtime is 60 seconds and in my project i have a few still images and a few motion clips, from a far when u first look at if you see the whole project on your TV, what im trying to do is when one of my motion clips starts playing i want to be able to zoom in some and pan across the still images from left and make it to the right side on my project where the clip is and be there before it starts playing, then back again to another clip somewhere in my project where the next clip is, then last have it pan across the images and zoom back out to normal view where it had started. This will be setup as a motion DVD menu, thanks for the help.

    Best to use a couple of paragraphs and full words.
    You are wanting to pan across still images?
    Try this:
    http://www.proapptips.com/proapptipsvideotutorials/194F4DC2-ACBB-4DD6-A1D0-F46D7 D8DCAFC/B3B1B666-3A04-4E0A-A6A1-F1EC7C9C653F.html
    or buy:
    FotoMagic or PhototoMovie
    or lyric media:
    http://www.lyric.com/fcp-plugins/panzoompro/pzp.htm
    Remember to mark responses solved or helpful.

  • Pan Image with AS2

    I am looking to create a similar effect to the one in this website:
    http://www.timoweiland.com/
    I have a large image that I would like to pan around on various button clicks and I have no idea how to begin.  Any help or a point to the right post/tutorial would really be appreciated. 

    Look into using the actionscript Tween class to change both _x and _y positions and _xscale and _yscale values gradually.  You might be able to find something thru Google using "AS2 Tween tutorial"
    That particular site uses more than one image to achive its effect.

  • Packaged app - image script problem

    I have a packaged app which has several scripts to install the underlying database objects and seed the initial data. It also runs as script to install the images which are specific to the app, not the workspace.
    The script is created using the export and hard codes the app ID. If a user installs the new app and chooses any other app number then the images are not associated with the app.
    Is there any sensible way to avoid the hard coding of these values in the script?
    EG:
    wwv_flow.g_flow_id := 457;
    AND:
    wwv_flow_image_api.remove_image(
    p_image_name => 'all.gif',
    p_flow_id => 457);
    wwv_flow_image_api.remove_image(
    p_image_name => 'none.gif',
    p_flow_id => 457);

    Scott
    I install the app as normal (from an export) but have scripts that run following the app. To make fewer steps for the end user, I was hoping to be able to use this, possibly modified as part of the supporting object scripts? If this is not possible I'll have to add more steps to the install. Is there any way of automating or adding this to the supporting object scripts or some other way I am not aware of please?
    Thanks
    Phil

Maybe you are looking for

  • Acrobat Pro 9 - Crashes when trying to change Postscript Prefs

    Hello all, I have Acrobat 9 on an Apple Xserve running 10.7.5.  I need to change the way Acrobat handles conversion from PDF to PS as the default is PS 2 not 3 plus other changes ... When I try to access the panel the app freezes and the crashes ...

  • Photo size is not displayed accurately

    After cropping a photo to 4x6 it displays as 3.5 x 7  This makes the photo distorted.  How do I fix the display to be accurate? People look shorter and fatter?  Help!

  • Does Photo Stream support GIFs?

    I'm trying to add a GIF image to my photo stream by putting it in the Uploads folder on my PC, but it won't come up on my iPod Touch. Does photo stream even support GIFs, and if so, any guesses to why it might not be working? It has worked with JPGs

  • Business Objects connectivity to Oracle

    Hello all, SID SERIAL# USERNAME SCHEMANAME OSUSER MACHINE TERMINAL PROGRAM LOGON_TIME 105 144 SYS boapp boprod WIReportServer@boprod (TNS V1-V3) 3/16/2011 6:00:57 AM 92 13453 SYS boapp boprod WIReportServer@boprod (TNS V1-V3) 3/15/2011 2:19:55 PM In

  • Creating slides of different lengths

    I want to use Keynote to create training videos. I am working on a test project. I created different video projects in IMovie for the different slides. Then I added each clip to its own slide. The clips are different lengths. I want the final project