# Image Paning help

**URL:** https://forum.kirupa.com/t/image-paning-help/265751
**Category:** flash
**Created:** [July 11, 2008, 10:06pm UTC](https://forum.kirupa.com/t/image-paning-help/265751 "2008-07-11T22:06:37Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Hypercomps](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@Hypercomps](https://forum.kirupa.com/u/Hypercomps)
#### Post date: [July 11, 2008, 10:06pm UTC](https://forum.kirupa.com/t/image-paning-help/265751/1 "2008-07-11T22:06:37Z")

</div>

Ok so I have been working on a project off and on for about a week and I just cant seem to get past this part of it. Basicly I have a panaramic image and I need the user to be able to scroll left and right so the image scroll left and right depending where the cursor is located. After some research on the website I found the code to do right on this website, the link to it is [kirupa.com - Interactive Image Panning, Page 1](http://www.kirupa.com/developer/flash8/interactive_image_pan.htm) when I attempt to add this just as it shows in the tutorial to my flash intro it gives me errors and doesnt work at all. I get the follow errors

> 1120: Access of undefined property \_xmouse. 1119: Access of possibly undefined property width through a reference with static type Class. 1119: Access of possibly undefined property width through a reference with static type Class. 1120: Access of undefined property bg\_mc.  
> Thanks ahead for anyone that takes the time to look into this problem! (Yeah I know I am new to flash)

---

<div class="post-metadata">

### Author: ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)
#### Post date: [July 11, 2008, 10:12pm UTC](https://forum.kirupa.com/t/image-paning-help/265751/2 "2008-07-11T22:12:21Z")

</div>

Are you publishing using ActionScript 3? (Press Ctrl+F3 to bring up the properties inspector to find out) The tutorial was designed for ActionScript 2.

Alternatively, you can try using the version of the code that I rewrote in ActionScript 3: [http://reclipse.net/kirupa/tutorial/imagePan\_AS3.fla](http://reclipse.net/kirupa/tutorial/imagePan_AS3.fla)

---

<div class="post-metadata">

### Author: ![Hypercomps](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@Hypercomps](https://forum.kirupa.com/u/Hypercomps)
#### Post date: [July 11, 2008, 10:19pm UTC](https://forum.kirupa.com/t/image-paning-help/265751/3 "2008-07-11T22:19:20Z")

</div>

Oh yes I am publishing user ActionScript 3 Thank you!

When I click on the link it just shows text, I do know its suppose to be a download but for some reason my browser isn’t letting me download the file?

---

<div class="post-metadata">

### Author: ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)
#### Post date: [July 11, 2008, 10:21pm UTC](https://forum.kirupa.com/t/image-paning-help/265751/4 "2008-07-11T22:21:03Z")

</div>

> When I click on the link it just shows text, I do know its suppose to be a download but for some reason my browser isn’t letting me download the file?

Yeah, that is just because my server is sending the wrong MIME type for the FLA filetype. When the text is up, just do File \> Save As… and then it should work properly.

---

<div class="post-metadata">

### Author: ![Hypercomps](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@Hypercomps](https://forum.kirupa.com/u/Hypercomps)
#### Post date: [July 11, 2008, 10:26pm UTC](https://forum.kirupa.com/t/image-paning-help/265751/5 "2008-07-11T22:26:29Z")

</div>

Thank you so much for the help and fast responses!

---

<div class="post-metadata">

### Author: ![Hypercomps](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@Hypercomps](https://forum.kirupa.com/u/Hypercomps)
#### Post date: [July 11, 2008, 10:35pm UTC](https://forum.kirupa.com/t/image-paning-help/265751/6 "2008-07-11T22:35:57Z")

</div>

Ok sorry, I am not understanding what you did because your old tutorial was set up different then your .fla that you just sent me it seems. When I look at where you have added the action script you have made a separate layer above the “bgImage” layer called “action” which contains the ActionScript on the first frame. But in your tutorial it says to apply the ActionScript to the Movie clip layer on the 1st Frame (Which is the Background image Movie Clip). When I do apply the ActionScript to the frame of my movie clip it gives me an error saying

> 1120: Access of undefined property bg\_mc.  
> am I naming the layers wrong or does that matter in this case? Once again thank you for your time its greatly appreciated!

---

<div class="post-metadata">

### Author: ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)
#### Post date: [July 11, 2008, 11:50pm UTC](https://forum.kirupa.com/t/image-paning-help/265751/7 "2008-07-11T23:50:19Z")

</div>

The name of the layer doesn’t matter. Actually, it doesn’t really matter which of the three layers the ActionScript is on, since they don’t really exist once the movie has been compiled.

Have you completed the step that looks like this?: ![](http://forum.kirupa.com/uploads/kirupa/7057/32d6c7bd869806b3.gif)

If that doesn’t fix it, then you may want to find the option “Automatically declare stage instances” in Publish Settings \> Flash \> ActionScript version: Settings \> Stage and enable it if it hasn’t been enabled already.

---

<div class="post-metadata">

### Author: ![Hypercomps](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@Hypercomps](https://forum.kirupa.com/u/Hypercomps)
#### Post date: [July 12, 2008, 12:06am UTC](https://forum.kirupa.com/t/image-paning-help/265751/8 "2008-07-12T00:06:49Z")

</div>

Yeah I tried every step over and over and doesn’t seem to be working. I am still getting the compile error also. I checked to see if the Automatically declare stage instances was enabled and it was. Could I send you the .fla and you look at it? If not what other options do I have?

---

<div class="post-metadata">

### Author: ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)
#### Post date: [July 12, 2008, 12:07am UTC](https://forum.kirupa.com/t/image-paning-help/265751/9 "2008-07-12T00:07:28Z")

</div>

Sure, I’ll take a look at it.

---

<div class="post-metadata">

### Author: ![Hypercomps](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@Hypercomps](https://forum.kirupa.com/u/Hypercomps)
#### Post date: [July 12, 2008, 12:27am UTC](https://forum.kirupa.com/t/image-paning-help/265751/10 "2008-07-12T00:27:42Z")

</div>

Sent, and thank you!

---

<div class="post-metadata">

### Author: ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)
#### Post date: [July 12, 2008, 1:00am UTC](https://forum.kirupa.com/t/image-paning-help/265751/11 "2008-07-12T01:00:43Z")

</div>

Okay:

[LIST=1]  
[_]You still had some of the old ActionScript 2 script on the signlight1 symbol. That was causing some troubles for the compiler.  
[_]Move the ActionScript on the ‘bg’ layer forward 2 frames so that it runs on frame 3, with the new keyframe.  
[_]Give the instance of trainstation\_symb the instance name ‘bg\_mc’.  
[_]Right click on the last frame (frame 101) on the ‘bg’ layer and click ‘Clear keyframe’. That will prevent the copy of trainstation\_symb from replacing the one that already has some event handlers registered on it.  
[/LIST]

That should make it work, or I can send you the modified version.

---

<div class="post-metadata">

### Author: ![Hypercomps](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@Hypercomps](https://forum.kirupa.com/u/Hypercomps)
#### Post date: [July 12, 2008, 1:05am UTC](https://forum.kirupa.com/t/image-paning-help/265751/12 "2008-07-12T01:05:32Z")

</div>

Can you send me the modifed files please?

---

<div class="post-metadata">

### Author: ![Hypercomps](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@Hypercomps](https://forum.kirupa.com/u/Hypercomps)
#### Post date: [July 12, 2008, 1:35am UTC](https://forum.kirupa.com/t/image-paning-help/265751/13 "2008-07-12T01:35:43Z")

</div>

Thank you! =]

---

<div class="post-metadata">

### Author: ![Hypercomps](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@Hypercomps](https://forum.kirupa.com/u/Hypercomps)
#### Post date: [July 12, 2008, 1:54am UTC](https://forum.kirupa.com/t/image-paning-help/265751/14 "2008-07-12T01:54:59Z")

</div>

Sorry to bother you once again but is there a way to have it so the Movie Clips I placed on top of the background move with it? Instead they seem to not move yet the background does, take a look [http://www.StreetFamous.net/work.swf](http://www.StreetFamous.net/work.swf)

---

<div class="post-metadata">

### Author: ![Hypercomps](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@Hypercomps](https://forum.kirupa.com/u/Hypercomps)
#### Post date: [July 12, 2008, 8:12am UTC](https://forum.kirupa.com/t/image-paning-help/265751/15 "2008-07-12T08:12:50Z")

</div>

Sorry I got this to work just fine! Thank you for all your help and great website!
