homepage Welcome to WebmasterWorld Guest from 54.163.72.86
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

    
Dynamically changing a flash movie
SethCall




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


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 :)

 

mivox




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

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.

SethCall




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

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
document.getElementById("flashMovie").setAttribute("width","400px")
a try

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

SethCall




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

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 :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved