First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: Brent Thomson | Website:

How AgileVR Works

Now that you've got your picture...
Now you're ready to start your Flash movie. At this point your natural urge will be to make a new movie clip and immediately importing the huge image file that you just created. Don't do it. Flash isn't particularly fond of objects as large as your picture most likely will be. You'll find that if you try to import it and manipulate it very much, Flash will crash. Therefore, it's a better idea to make your movie and set up all your code before placing your image.

Step 1: Understanding how the darn thing works.
The concept behind an agileVR really isn't very complicated. There are two identical movie clips that contain the image. There is an invisible button that detects when the viewer presses the mouse button. There is an invisible movie clip being dragged that supplies the mouse's current position. When the user presses his/her mouse button, the invisible button sets two variables according to the x-value of the mouse at the instant the button was pressed (it gets these from the invisible dragging movie). It also tells another invisible movie clip to play. This second movie clip takes the initial mouse coordinates and compares them to the current position of the mouse. From this simple calculation, the movie clip comes up with an x-offset for the image movies. The movie clip then updates the position of both image movie clips by that values, checks if one of the movies is too far off of the screen, and then loops. Frame one of the update clip has a stop for when the user does not have his/her mouse button pressed. The second and third frame contain the actual code that makes the movie pan. The code in the third frame of my update movie looks something like this:

Begin Tell Target ("../")
      Set Variable: "x" = GetProperty("/hidden", _x)
      Set Variable: "offset_x" = (start_x - x) / 8
      Set Variable: "cur_x1" = GetProperty("/movie1", _x)
      Set Variable: "cur_x2" = GetProperty("/movie2", _x)
      Set Property ("/movie1", X Position) = cur_x1 + offset_x
      Set Property ("/movie2", X Position) = cur_x2 + offset_x
End Tell Target
Go to and Play (2)

Frame two checks to see if either image movie is far enough the screen that it can be situated on the opposite side. This makes it look like the image is one continuous picture.

» Level Intermediate

Added: 2000-03-16
Rating: 7 Votes: 239
(10 being the highest)
» Author
No Information Given
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!


  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.