Skip to main content
January 10, 2013
Answered

Is it possible have the css code within the main .FLA without having it externally?

  • January 10, 2013
  • 1 reply
  • 823 views

I'm trying to have everything within one .FLA because this file will be moved around everywhere and having an external CSS posses a liability and something not working right, so I've been looking around the net with no luck so I'm here asking...

Is it possible to have all of it in one frame and just call for it when needed. So far I've been able to simplify the as2 code to call the CSS but still can't make it be within the .FLA (still requires an external file)

this is in frame one.

var format = new TextField.StyleSheet();

format.load("flash.css");

output.styleSheet = format;

output.text = "<br><p class='one'>I don't like external files.</p>";

it works well... but like i said...

Thank you in advance for your time and response

also...

does flash hate border styles?... can't get them to work...

This topic has been closed for replies.
Correct answer kglad

eg:

var styles:TextField.StyleSheet = new TextField.StyleSheet();

styles.setStyle("bodyText", {fontFamily: 'Arial,Helvetica,sans-serif', fontSize: '12px'}

);

styles.setStyle("headline", {fontFamily: 'Arial,Helvetica,sans-serif',fontSize: '24px'}

);

1 reply

kglad
Community Expert
Community Expert
January 10, 2013

you can define css styles on your timeline.

January 10, 2013

That's where I'm left in blank.... I tried just putting in the css style into a frame but no luck, flash doesn't recognize it as a code, so I don't know the proper way to do this...

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
January 10, 2013

eg:

var styles:TextField.StyleSheet = new TextField.StyleSheet();

styles.setStyle("bodyText", {fontFamily: 'Arial,Helvetica,sans-serif', fontSize: '12px'}

);

styles.setStyle("headline", {fontFamily: 'Arial,Helvetica,sans-serif',fontSize: '24px'}

);