header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Ramakrishna
Points:0
Posts:0

7/12/2010 12:41:20 AM

Title: How to loadd css file at run time


Hi,

How to load css file at runtime?

Regards,
K.V.Ramakrishna



1
nannu
Points: 0
Posts:0
7/12/2010 2:25:14 AM



hi rama,

check this out...

http://livedocs.adobe.com/flex/3/html/help.html?content=styles_10.html

http://stackoverflow.com/questions/204924/how-do-you-dynamically-load-a-css-file-into-a-flex-application


2
Shawn
Points: 270
Posts:0
7/12/2010 5:31:59 AM



check this thread
http://askmeflash.com/qdetail/860/adding-css-file

3
Wilbur
Points: 260
Posts:0
7/12/2010 8:31:12 PM



here goes the simple example to load dynamic stylesheet dynamically in flex or flash builder. Remember to right click on css file in flex and select "compile as swf" so that its converted to swf automatically.

<?xml version="1.0"?>
<!-- styles/BasicApp.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        <![CDATA[
        import mx.styles.StyleManager;
        public function loadStyleSheet():void {
            StyleManager.loadStyleDeclarations("dynamicStyleSheet.swf")
        }
        ]]>
    </mx:Script>    
    <mx:Button label="Click Me to load StyleSheet" click="loadStyleSheet()"/>
</mx:Application>


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 5+1 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions