PDA

View Full Version : Q: Can Flash make a dynamic carosel


gmask
06-20-2003, 03:06 AM
Is flash capable of creating a dynamic carosel where the images in the roating image bank can be updated by simple replacign the one sample image on the server.

Flash is capable of editting images to be skewed as if distorted by parallax shifting IE 3D but can it do it in realtime?

http://www.gmask.com/carosel.mov

It this you see an dimage spinning around well I want to beable to change that image by simply replacing it on the server.

I think Director MX can do this but can Flash?

Any ideas?

speC
06-23-2003, 04:04 PM
for sure

there are several ways to do this.
depending on the way you want to do it(or
on your skills)
the easiest way is to do it manual by:
-creating a mc which is a placeholder
for the pic.
-loading the pic in the first frame of the main timeline
through "loadMovieclip" and targeting to
the instancename of the created mc
-finish
if you want to do it more dynamically you should
load a variable which is placed in an external
.txt file(which may be produced with php or
much more simple by you manually).
and specify the targeted pic.

good luck

speC

perhaps it's better
to look up ton special-actionsript refers.

gmask
06-23-2003, 04:53 PM
Spec, I actually knew all that what I am referring to is the illusion of perspective... is that possible combined with the dynamism.

marchermann
06-24-2003, 09:49 AM
I think, what speC probably ment was that you could manually animate a dummy MC to do the carousel with all the required distortions and then replace it with an image at runtime, thus keeping the animation.

MCs unfortunately don't have a property "_skew" or something like that.

But it won't surprise me if there is a workaround. Maybe if you have one pre-skewed MC you can strech and rotate it to any shape you like. But if you want just this animation, no interactive change of perspective on the carousel, pre-animating it should be fine.

There's a book called "Flash MX 3D Graphics Bible" which sounds like it might answer your question better than I can.


Marc

PS: I like the graphics on your homepage. Nice colours.

cyrenevjacob
06-24-2003, 12:54 PM
Hi there!
You can very much create such an effect...but I have only got the theory...you 'll have to see if it really works....this is how you can make the effect....make an empty placeholder movie clip( ie a movie clip which only has a reference rectangle or something) which rotates the way you want it to....then using Flash MX's....movieclipname.attachMovieClip("targetname"); you can attach any jpg from within your library to this movieclip.....after each rotation or sequence you can change the picture accordingly....through code, through an external text file or by using XML....However you'll have to do a lot of tweaking like having the correct image size, resolution etc....
Cheers,
Cyrene

gmask
06-24-2003, 05:22 PM
Originally posted by marcboy
I think, what speC probably ment was that you could manually animate a dummy MC to do the carousel with all the required distortions and then replace it with an image at runtime, thus keeping the animation.

MCs unfortunately don't have a property "_skew" or something like that.

But it won't surprise me if there is a workaround. Maybe if you have one pre-skewed MC you can strech and rotate it to any shape you like. But if you want just this animation, no interactive change of perspective on the carousel, pre-animating it should be fine.

There's a book called "Flash MX 3D Graphics Bible" which sounds like it might answer your question better than I can.




Thanks.. that sounds like a possibilty..

speC
06-25-2003, 09:12 AM
thx marcboy, but i missunderstood
gmasc.(my english is helpless)

as i know there is no proper buildin-script function
which makes this possible, but marcboy
allready said it. perhaps theres a workaround!?!
:surprised

i peronally thing it.s much more
easier an faster to work if you setup
once the .fla with all the
_skew, _rotate.... and then
only update the .jpg in the
lib render it and load it up on your server.

...i know...thats not professional
but am i?

DocBoom
06-25-2003, 09:50 AM
sorry, this isn´t possible. You can´t skew an image in flash. All the 3d engines for flash only use flat shaded objects. You simply can´t distort an image perspectively in flash.

marchermann
06-25-2003, 10:07 AM
DocBoom, I just tried it out, and it worked (at least in Flash MX).

I used a simple rectangle as a movie clip. I rotated, skewed and distorted it and animated all this on the timeline. I replaced the MC with a .jpg at runtime and the image did the same stuff as the original MC.

I then replaced the rectangle with an image already in Flash and it worked as well. :shrug:

Marc

DocBoom
06-25-2003, 12:38 PM
yeah? That´s strange, cause all i can do with movie clips is scale and rotate :surprised
could you please try to create a perspective effect, like a plane or a falling wall?

marchermann
06-25-2003, 12:47 PM
Via actionscript you can access only the _rotation, _xscale and _yscale properties, true.

But I was talking about deforming the MC with the design tools available in Flash MX, not via actionscript. As you can see in the test.swf I was able to freely distort an image, but this was *all done and animated in the authoring environment and not at runtime*.

Marc

DocBoom
06-25-2003, 12:55 PM
uhmm... da geht mir das englisch aus... :)
auf die art und weise kannst du nur eine parallelperspektive erzeugen, aber keine fluchtpunktperspektive (ausser natürlich ich stelle mich zu dumm an... in dem fall lass´ich mich gern berichtigen).
Könnte allerdings auch sein, das das für diesen fall hier ausreicht...

gmask
06-25-2003, 04:39 PM
Originally posted by marcboy
DocBoom, I just tried it out, and it worked (at least in Flash MX).

I used a simple rectangle as a movie clip. I rotated, skewed and distorted it and animated all this on the timeline. I replaced the MC with a .jpg at runtime and the image did the same stuff as the original MC.

I then replaced the rectangle with an image already in Flash and it worked as well. :shrug:

Marc

I checked it out and that only looks like rotation and scaling.. it's not skewed as in one edge is taller than the other..ala parrallax distortion. ???

marchermann
06-25-2003, 04:49 PM
Shame on me. When you were asking for perspective I always thought "isometric" because that's what I usually do in Flash.

OK, now you can't distort an MC into a trapezoid, but you can definitely skew it, i.e. make parallelograms. Better than nothing, eh? ;)

DocBoom
06-26-2003, 08:08 AM
You could of course make one movieClip vor each pixel in the image and scale and move them around to create perspective. Might be somewhat slow however... :rolleyes:
Got a supercomputer at home? :p

gmask
06-26-2003, 04:58 PM
Originally posted by DocBoom
You could of course make one movieClip vor each pixel in the image and scale and move them around to create perspective. Might be somewhat slow however... :rolleyes:
Got a supercomputer at home? :p

Yeah that might work.. the "client" doesn't really have any concept of wait users are willing to wait for. Anywho..I'm just trying to help out a friend by getting the question answered and sof ar it seems a resounding no is appropriate .. I mean anything is possible if you can program it in C.. right?

Sacha02
06-27-2003, 10:04 AM
I know i've already seen this, it's possible

i'm trying to find the source file right now, but my hard drive is such a mess...

Sacha02
06-27-2003, 10:10 AM
OK, now you can't distort an MC into a trapezoid, but you can definitely skew it, i.e. make parallelograms. Better than nothing, eh?

that's true. but you should be able to achieve the effect you're looking for using only this.

OR

alternate method (what was used in the file i'm looking for and that I can't find):

-animate a single movieclip deforming like you want it to

-duplicate it

-set each duplicate at a different moment in the cycle according to their place in space

this will probably work.

Is flash capable of creating a dynamic carosel where the images in the roating image bank can be updated by simple replacign the one sample image on the server.

this is possible too, but you'll need to use php or xml. I think the simplest way to do that would be to write a small php script to analyse the content of a folder (the functions all already exists, it's quite simple) and then load the variables from the script (which would be the file's names) in flash.

EDIT:
some more precisions: what you'll need to animate is just the deformation of the clip, and probably only in one way (you can get the mirror deformation by reverting the _xscale to -100 ro mirror the clip).
The actual movement, is done using an eliptical trajectory (use a parametric trajectory with cos and sin), and the scaling is done using xscale and yscale.
So, to sum up:
-you animate the trapezoid deforming
-you program the rest of the effect

And inside the trapzoid is a placeholder MC for your image.

I don't know if this is clear.. you can send me a private message if you need more info.

And you can also visit ultrashock.com or actionscript.org to get more info and source codes.

Sacha02
06-27-2003, 11:10 AM
well i DID find it eventually:

is this what you're looking for ?

http://www.ultrashock.com/flas/Detailed/154.html

marchermann
06-27-2003, 11:21 AM
That's a nice illusion.

I think, while the shapes have this kind of perspective to them, the content does not (see the text "menu item"). I suppose they are either filled with bitmaps or animated masks on top of a squashed bitmap. The latter version would still allow for dynamically replacing the images.

Very nice, indeed.

Marc

gmask
06-27-2003, 04:01 PM
Originally posted by Sacha02
well i DID find it eventually:

is this what you're looking for ?

http://www.ultrashock.com/flas/Detailed/154.html

They that pretty much looks like it!

Thanks

Sacha02
06-27-2003, 04:36 PM
cool !

if you have any problem understanding the source code don't hesitate to ask.
Actionscript is pretty much the only thing i'm not too bad at, so I'll be glad to help you.

gmask
06-28-2003, 08:49 PM
Originally posted by Sacha02
cool !

if you have any problem understanding the source code don't hesitate to ask.
Actionscript is pretty much the only thing i'm not too bad at, so I'll be glad to help you.

Yeah.. it's pretty complex.. since he's copyrighted it I guess we are going to try to license it from him. I'm just glad to finally know wether or not it can be done. We visit ultrashock often but just never came across that post. I guess since it was written in Flash 5 the code has changed in MX but it still works.

CGTalk Moderation
01-15-2006, 11:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.