Action script 1 to actionscript 2?

Posted on 2006-07-16
Last Modified: 2006-11-18

I have a panorama vr flash file that I need to convert to actionscript 2 - can anyone help?

I think the main culprit is the 'startDrag' function:

startDrag("dragControl", true);

can anyone convert this to AS2? Or should I just put a link to the .fla file?

thanks all,

Question by:isotherm
  • 2
  • 2
LVL 16

Expert Comment

ID: 17118526
That code is vaild AS2.0


Author Comment

ID: 17118543
In fact here it is. Thanks so much for any help converting this :-)

LVL 16

Accepted Solution

sam85281 earned 125 total points
ID: 17118660
Replace the code in frame 1 of dragControl movie with this:

// -------------------------------------------
// -------------------------------------------
// SET DRAG SPEED (inverse)
speed = 45;
w = _root.nav._width;
xPos = _root.dragControl._x;
yPos = _root.dragControl._y;
// next line centers the menu drag to the screen
xPos = xPos - (600 / 2);
_root.nav._x = _root.nav._x - (xPos / speed);
if (Number(_root.nav._x) < Number(-(w/2))) {
      _root.nav._x = 0.01;
} else if (Number(_root.nav._x) > 0) {
      _root.nav._x = -w / 2;

The replace code in frame 1 of nav movie clip with this:

// --------------------------------------------
// tmi=total duplicates (2)
// dup=new movie duplicates
// butn=original movie
// --------------------------------------------
m = 0;
while (Number(m) < Number((_root.tmi * 2) -1 )) {
      m += 1;
      dup = "butn" add m;
      // Depth of this layer and depth of city layer CANT be the same. So in this layer I add 10 to the depth to make sure of that.
      duplicateMovieClip("butn", dup, Number(m)+10);
      dup._x = Number(dup._x) + Number(m*dup._width);


Author Comment

ID: 17118710
Hi Sam,

thanks very much that's fantastic - there's something odd going on though - it seems to 'jump' now where it didn't in AS1......
any ideas why that would be?

thanks again :-)

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Flash media server 1 327
anti-download video publishing site? 6 612
Flash being Disabled - help! 20 338
How to emebed .XML into  flash to make a self contained .SWF 1 175
This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now