Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Dynamically changing a flash movie



7:24 am on Mar 11, 2003 (gmt 0)

10+ Year Member

I am just now learning Flash, and I gotta ask you guys:

is their a way to dynamically change the size of a flash movie? On top of that, can you make it "move", my changing left and top property in your stylesheet?

I noticed that the object tag has a nasty hardcoded height= and width= property. Can you use percentages for that? Or better yet, leave them out and use a style sheet instead? I have been searching all over, and all my searches lead to a talk about using tables to stretch the movie, but im really looking for a more elegant way of doing so.

If you *could* change the size and move your flash movie around, you could so some pretty interesting things I imagine.

Thanks for any help guys. I usually hang out in the CSS forums, but you might see a little more of me in here from now on too :)


7:46 pm on Mar 11, 2003 (gmt 0)

WebmasterWorld Senior Member mivox is a WebmasterWorld Top Contributor of All Time 10+ Year Member

My first guess is that you might need javascript for those sorts of changes... but hopefully bumping the thread will call out some Flash experts who know more specifics.


9:35 pm on Mar 11, 2003 (gmt 0)

10+ Year Member

yeah i figure javascript would be a part of it.

for instance, lets just say you can not control the width/height/left/top of a flash movie from css.

well, there is the "setAttribute" javascript function,

which allows you to change the exact attribute writtin in the tag.

So I have 2 things to try, once i get a sample flash movie (im at work so it will be a few hours).

one is this <object id="flashMovie" width="300px" height="300px">blahblabah</object>

and then to do a

document.getElementById("flashMovie").style.width = "400px"
, and see what that does.

If that doesn't do anything, then I will give

a try

Im hopeful I can work that somehow. Just have to test it in a little bit.


4:18 am on Mar 13, 2003 (gmt 0)

10+ Year Member

First of all, everyone should be aware of this: this has caused me unknowable heartache:

I dont believe this is a problem in a non-local situation (client-server).

but say you have your html file and flash movie on your harddrive.

Well, Mozilla takes just a wee bit of time to load the movie, even though its local. But it also doesn't responsd to "PercentLoaded()", which is a problem. Commanding the movie using javascript-to-flash scripting fails (cuz the object in the DOM model isn't there yet, or something like that).

So, before you try to control the flash movie, do a setTimeout before your first function (like StopMovie, or GotoFrame, or whatever you are trying to do).

But, I dont *think* this is an issue in a normal situation: just when you are testing on a local machine...

Back to messing with controlling the width/height and position of the flash movie on the fly :)


Featured Threads

Hot Threads This Week

Hot Threads This Month