PDA

View Full Version : dynamically change styles, bitmaps, graphic symbols, etc... in a Flash movie


hugobossv8
12-07-2004, 06:07 PM
Hello,

I'm trying to come up with a way to dynamically change all styles of a Flash movie - basically skin the movie. I will not only need to change the styles of components, but also of graphic symbols, bitmaps, fonts, etc... I will need to change the styles based on a skin the user chooses. Since the library contains all of the symbols, I'm wondering if it would be a good idea to implement a shared library that dynamically changes when the user selects a different skin...is this possible...I've never used shared libraries? Or does anyone have any other suggestions?

Thanks!

Bosworth
12-12-2004, 04:17 AM
you might have some luck useing the setProperty function based on a button click-


on (release) {
setProperty(target:Object, property:Object, value/expression:Object) ;
}

You could use this to change, for example, the all the text color, the background color, button color etc. all at once - given predefined sets that you choose - or you could set up some variables to let the user change each item on the fly (with the color picker comoponent).

I have used this with good results on a couple of project - not to change the whole skin but - to change specific element properties.

somewhere to start anyway...

good luck

b()X

Bosworth
12-12-2004, 05:59 AM
ok - I wz thinking about this and had a better idea - - -

- use the attachMovie function.

you make several versions of the same idea (ie - logo, background, text, any other elements). Store them all in the same library and check the "export for actionscript" box - then give each piece a linkage name (ie - logo 1, logo 2, logo 3). This works very much like a "shared library" as you described...

you then specify the level and the location of each piece - which you might have to toy arround with a little bit -

I made up a little example of this scheme and it should be pretty straightforward.

let me know how it goes :)


b()X

hugobossv8
12-13-2004, 06:24 PM
Thanks for your thoughts on this Bosworth, it's much appreciated. attachMovie is a good idea. This is one of the ideas I was considering. However, the issue is that it may not be very scalable. The library of skins may expand to 10 maybe 20 different skins. Exporting for ActionScript for all of the skins will bloat the size of the Flash movie since the Flash movie will have to store all of the graphics for all of the skins. I want the Flash movie to be the size of only one skin.

Thanks!


ok - I wz thinking about this and had a better idea - - -

- use the attachMovie function.

you make several versions of the same idea (ie - logo, background, text, any other elements). Store them all in the same library and check the "export for actionscript" box - then give each piece a linkage name (ie - logo 1, logo 2, logo 3). This works very much like a "shared library" as you described...

you then specify the level and the location of each piece - which you might have to toy arround with a little bit -

I made up a little example of this scheme and it should be pretty straightforward.

let me know how it goes :)


b()X

Bosworth
12-13-2004, 06:31 PM
gotcha....
and that does present some problems... lol.

That being said - the setProperty method might be more appropriate (code is less dense than tweens) - but it definately limits you to one basic skin...

maybe a little from column A and a little from column B??

good luck!

Whargoul
12-13-2004, 08:03 PM
separate each skin into "sections" so say like 4 different full skins could be mix-matched. then columnA*columnB=alot.