Be a Supporter!

Repeat a movieclip?

  • 362 Views
  • 5 Replies
New Topic Respond to this Topic
Feglk
Feglk
  • Member since: Sep. 18, 2008
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Repeat a movieclip? Jun. 25th, 2012 @ 04:37 AM Reply

I want to make a almost google street view like application in flash. I want the user to be able to look 360 degrees around a room, spinning on one point, then i'll add other interactivity etc.

An idea I had to do this was to have a 360 degree panoramic photograph, then use the arrow keys to move it left and right, meaning that it will give the impression of spinning in a room. The problem, obviously, is that you reach the edge of the image. I could just repeat the image but then it would keep increasing the file size, and if somebody kept a key held down they would eventually reach the edge.

Is there any way to "loop" or repeat the movieclip so that it repeats itself indefinitely? It only needs to repeat across X

oh and i am using Actionscript 2 and flash CS5.5

Thanks!

Mufanza
Mufanza
  • Member since: Aug. 22, 2009
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Repeat a movieclip? Jun. 25th, 2012 @ 01:08 PM Reply

At 6/25/12 04:37 AM, Feglk wrote:

:The problem, obviously, is that you reach the edge of the image. I could just repeat the image but then it would keep :increasing the file size

You're very close here. Just create the image again once the user reaches the edge. You will have two images now. When the first image gets out of sight, just remove it (or move it to the other edge).
You will repeat two images like this infinitely - no memory leaks, no great filesize.

Alternatively, I think that cube which google street view uses is open-source. You can try to look it up.

Attila0413
Attila0413
  • Member since: Dec. 10, 2009
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to Repeat a movieclip? Jun. 25th, 2012 @ 08:55 PM Reply

Store the BitmapData of the panoramic photo and copy the needed pixels from it on your Movieclip.


BBS Signature
Feglk
Feglk
  • Member since: Sep. 18, 2008
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to Repeat a movieclip? Jun. 26th, 2012 @ 06:17 AM Reply

At 6/25/12 01:08 PM, Mufanza wrote: Just create the image again once the user reaches the edge. You will have two images now. When the first image gets out of sight, just remove it (or move it to the other edge).
You will repeat two images like this infinitely - no memory leaks, no great filesize.

That seems like a great idea, do you know the code I would use to do that?

Mufanza
Mufanza
  • Member since: Aug. 22, 2009
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Repeat a movieclip? Jun. 27th, 2012 @ 06:18 AM Reply

At 6/26/12 06:17 AM, Feglk wrote: That seems like a great idea, do you know the code I would use to do that?

Actually, Attila0413's solution is better.

MintPaw
MintPaw
  • Member since: Jun. 11, 2006
  • Offline.
Forum Stats
Member
Level 10
Programmer
Response to Repeat a movieclip? Jun. 27th, 2012 @ 01:41 PM Reply

We don't give hand out code here, and we don't educate people from knowing nothing. Look around and learn how to generally program yourself first, then attempt to do it yourself.

If you can't then ask on the forum and post the code you used and most times someone will correct it for you. If you're really culeless like you are now then all we can do is push you in the right direction like we have. Occationally some scrub will come and post all the code for you to copy and paste but it's rare.


If ya have something to say, PM me. I have a lot of time to spare.
Also never PM egg82.

BBS Signature