# Best practice for setting styles in module based site?

**URL:** https://forum.kirupa.com/t/best-practice-for-setting-styles-in-module-based-site/45158
**Category:** flash
**Created:** [March 11, 2004, 3:24pm UTC](https://forum.kirupa.com/t/best-practice-for-setting-styles-in-module-based-site/45158 "2004-03-11T15:24:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jugglerpm](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@jugglerpm](https://forum.kirupa.com/u/jugglerpm)
#### Post date: [March 11, 2004, 3:24pm UTC](https://forum.kirupa.com/t/best-practice-for-setting-styles-in-module-based-site/45158/1 "2004-03-11T15:24:52Z")

</div>

I am interested in discussion/advice regarding the best Actionscript practice for setting styles via text formats and color variables for a module based site.

Currently I have text formats and color variables set up in my Main swf file. I would like to be able to use those same styles in numerous modules that will be loaded into the Main swf file.

Image shows swf relationship:

![](http://www.rit.edu/~gpm9103/thesis/module_formatting.gif)

A) Is it possible to target the style variables in “main.swf” from “module2.swf”? I haven’t been successful in my attempts so far.

B) I could use an external Actionscript file, I think. But that would be an additional call to the server to load each module. Is that worth worrying about?

Thanks for your thoughts.

-pm

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 11, 2004, 4:09pm UTC](https://forum.kirupa.com/t/best-practice-for-setting-styles-in-module-based-site/45158/2 "2004-03-11T16:09:15Z")

</div>

You can’t use an external AS file, because that gets included into the/each swf when you compile.  
How did you try to apply a style from \_level0 to one of the loaded swfs?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 11, 2004, 4:24pm UTC](https://forum.kirupa.com/t/best-practice-for-setting-styles-in-module-based-site/45158/3 "2004-03-11T16:24:13Z")

</div>

Joe,

In the module I tried:

textField\_txt.setNewTextFormat(\_parent.myTextFormat);

But I’m guessing there’s something wrong with that concept. Is that the direction I need to take?

-pm

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 11, 2004, 4:54pm UTC](https://forum.kirupa.com/t/best-practice-for-setting-styles-in-module-based-site/45158/4 "2004-03-11T16:54:16Z")

</div>

try \_level0 instead of \_parent… not sure 😉

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 11, 2004, 5:34pm UTC](https://forum.kirupa.com/t/best-practice-for-setting-styles-in-module-based-site/45158/5 "2004-03-11T17:34:36Z")

</div>

no luck with \_level0 so far, but thanks for the post. -pm
