First time here? First time here? Newsletter Signup Newsletter
651326 Members and growing! | Flash Jobs
Search tutorials
Author: Brent Thomson | Website: http://www.agilestudios.com

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!

Comments

  • 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: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
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: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.