Jump to content


Photo

A difficult actionscript endeavor?


  • Please log in to reply
5 replies to this topic

#1 eXige

eXige

    Young Padawan

  • Members
  • Pip
  • 16 posts

Posted 16 November 2006 - 07:06 PM

What I want to do is make a "3D" view of a product in flash for many products. In this case, batting gloves. I want to know how tho make it so that when they click and drag to the right in the area, it goes to the next image one by one as they drag, and goe sbackward as thy drag left.

Example (#'s are image numbers):

(click on glove)(drag to right)1-2-3-4-5-6-7-8-9-10-1-2-3-4-5-6 (start dragging to the left) 6-5-4-3-2-1-10-9-8

Hope that explains what I mean.

Once I get that down, I want the images to load dynamically... from a certain file, say an XML file of the list of the 10 images. This is NOT necessary, but will help on bandwidth and time.

The way I see it, there would be one flash file. The flash file would grab the XML url from the HTML file the SWF is within (no idea how to do that or if it is even possible). Then from there, it checks for image URLs in the XML file, and loads them to their respective position (e.g. 1-10) based on the name the XML file has it like:

<1>http://blah.com/glove1.jpg</1>
<2>http://blah.com/glove1.jpg</2>
etc...

Is THAT part possible? If not, I will have to make an SWF for each product, and 1) that will be very painful and I will probably rule this 3d view idea out and 2) it would bog down the bandwidth unnecessarily.

OR!!!!
There's a better way to do this! Maybe in ImageReady or something?

Anything will do for this, MUCH MUCH THANKS! I will not leave anyone without their credit.

#2 Demonslay

Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 973 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 16 November 2006 - 10:34 PM

I'm not in any part good at Flash or ActionScript, but this may get you started atleast on the XML part.
http://www.pixel2lif...earch/12/xml/1/

Hope that helps, and have you tried searching first? :mellow:

#3 Ben

Ben

    P2L Jedi Master

  • Publishing Betazoids
  • PipPipPipPip
  • 1,366 posts
  • Gender:Male
  • Location:VIC, Australia

Posted 19 November 2006 - 01:20 AM

Thats a good idea for a tutorial, making a 3D dragable view. I might write it up for that competition.

#4 eXige

eXige

    Young Padawan

  • Members
  • Pip
  • 16 posts

Posted 20 November 2006 - 08:11 PM

You really should... it would help me a lot!!

#5 Tromac

Tromac

    Young Padawan

  • Members
  • Pip
  • 56 posts

Posted 21 November 2006 - 01:13 AM

Hey there,

What you want to make is a Virtual Reality Object, such as the ones that Apple use to preview their products on their website (although they are done in Quicktime).

Here is a tutorial I found on how to do this in Flash. I haven't tried it myself, but I hope it helps. :ph34r:
Flash VR Object Tutorial

#6 Ben

Ben

    P2L Jedi Master

  • Publishing Betazoids
  • PipPipPipPip
  • 1,366 posts
  • Gender:Male
  • Location:VIC, Australia

Posted 21 November 2006 - 02:48 AM

Thats pretty cool, but I did figure out how to make a much smoother, and less buggy, way to rotate 3D! So, eXige, I will write that tutorial I was talking about. Oh, and here it is:
http://www.flashimpu...rotating3d.html

And heres the code (if you're curious):
var startPos:Number;
hitBtn.onPress = function() {
	startPos = _xmouse;
	onMouseMove = function() {
		if(_xmouse < startPos) {
			//trace("backwards");
			startPos = _xmouse+1;
			clipMc.prevFrame();
			if(clipMc._currentframe == 1) {
				clipMc.gotoAndStop(clipMc._totalframes);
			}
		} else {
			//trace("forwards");
			startPos = _xmouse;
			clipMc.nextFrame();
			if(clipMc._currentframe == clipMc._totalframes) {
				clipMc.gotoAndStop(1);
			}
		}
		updateAfterEvent();
	}
}
hitBtn.onRelease = function() { delete onMouseMove; clipMc.play(); }
hitBtn.onReleaseOutside = function() { delete onMouseMove; clipMc.play(); }

I'll try recoding it so its easier to edit.

EDIT: Also, I'll work on the XML intergration for it. It should be easy.

Edited by d4rkst0n3, 21 November 2006 - 05:48 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users