CSS for Dynamically Loaded External Text

I'm externally loading text from a .txt file. I need to format that file using CSS. I've got the CSS file set up and everything. I've tried every tutorial I can find to try and load the CSS, but nothing is working.
Here is the script for loading the text:
var textLoader:URLLoader = new URLLoader();
var textReq:URLRequest = new URLRequest("content_files/commissions.txt");
textLoader.load(textReq);
textLoader.addEventListener(Event.COMPLETE, textLoadComplete);
function textLoadComplete(event:Event):void
    commissionscontent.htmlText = textLoader.data;
    commissionscontent.htmlText = textLoader.data.split("\r\n").join("\n");
        if (commissionscontent.maxScrollV <= 1){
        scrollBox_mc.visible = false;
        scrollLine.visible = false;
    else {scrollBox_mc.visible = true;
          scrollLine.visible = true;}
Can anyone help me to load the CSS for this?? I'm really new to Flash and have just been teaching myself, except for now I've hit a wall and I am so incredibly frustrated that it's not even funny.

var css_loader:URLLoader = new URLLoader();
var textLoader:URLLoader = new URLLoader();
var my_css:StyleSheet = new StyleSheet();
var my_txt:TextField = new TextField();
css_loader.load(new URLRequest("style.css"));
css_loader.addEventListener(Event.COMPLETE, onCSSComplete);
function onCSSComplete(e:Event):void {
    my_css.parseCSS(e.target.data);
    textLoader.load(new URLRequest("commissions.txt"));
textLoader.addEventListener(Event.COMPLETE, textLoadComplete);
function textLoadComplete(e:Event):void {
    my_txt.styleSheet=my_css;
    my_txt.htmlText=e.target.data;
    addChild(my_txt);
    my_txt.width=300;
    my_txt.autoSize=TextFieldAutoSize.LEFT;
    my_txt.wordWrap=true;

Similar Messages

  • Is Dynamic Loading of Text from an external file possible in Captivate?

    Hello all,
    I am wondering if Dynamic loading of text is possible in captivate or not.
    As we can load an external file in flash.
    & which is the universal font to be used for the text entry box which will visible on any media?
    Thanks & Regards,
    Chirag

    Hello,
    I'm not a specialist about JavaScript. Have a look at Jim Leichliter's blog:
    http://captivatedev.com/
    Lilybiri

  • Load external text in a user friendly way

    Ok this is what i want to do.
    I know how to load external text files in AS3 but I want the user to be able to do it from within my excited swf file. The obvious way to do this is to load the text file  using a string from a dynamic text field (e.g: "myfile/myTextFeild.txt") but i want it to be more user friendly.
    If you click file open in Microsoft word, for example, you get the user friendly open box where you can find the file you want to load by browsing through your hard-drive.
    Can you do something like this is AS3?
    Any feedback would be much appreciated.
    Thanks

    see if you can extrapolate the path from there. FileReferenceList.browse()

  • AS3: Loading External Text into a Master File

    I have a master file that I want to load an external text
    file into. This external text file will also have an external style
    sheet applied to it.
    In your opinion, which way is best to load the external text
    file?
    1) Generate a text field dynamically in the master file using
    the TextField class and then loading the external text in.
    2) Placing (at authoring time) a dynamic text box on the
    master file's stage and loading the text in.
    3) Placing a dynamic text box in a separate .swf file and
    then loading that external swf in to the master file, then loading
    the external text into the text box.
    Any opinions?
    Thanks...
    Brenda

    On my project im going with the third choise, dont ask why,
    cause i just do.
    only difference is that i also lad my data into this external
    swf file.
    in other words i use mainly second as well as im going with
    the third one.
    In my opinion, no idea if thats the best way, but i certanly
    know that its (for me) most confortable way.

  • Loading external text, transition effects

    does anyone know how the text effect seen on
    addition.com (under
    the details section) is made? Also, can it be made by loading an
    external text file? if anyone can help or point me in the right
    direction of a tutorial, it would be greatly appreciated.
    thanks-

    well, I hadn't seen the text under the details section, I
    hadn't even selected one of the menu items. So after doing so i
    think I have an answer for you, and did test the theory. If you
    adjust the 'leading' property of a the setTextField() function
    using a variable that is redefined within a loop, you can change
    the width of the line spacing. On the first frame used the code,
    var leading_fmt:TextFormat = new TextFormat();
    leading_fmt.leading = 30;
    leading_txt.setTextFormat(leading_fmt);
    onEnterFrame = function() {
    if(leading_fmt.leading > 0) {
    leading_fmt.leading -=1;
    leading_txt.setTextFormat(leading_fmt);
    Looks like you could adjust things however you would like
    using this method. I'm not certain how they created the color
    change though, I guessing that you could do that with a
    translucient mask effect over the top of the field, or by using the
    text as a mask rather. Just make sure that the character set you
    wanting to use is embed within the dynamic field, and you should be
    set.

  • How to load external text file into a Form?

    Hi,
    I made a menu with 1-5 in a Form and 5 external text files. I want the user who is able to view the text content of the text file when he chooses one of them from the menu. And the text file screen has a "Back" command button to let him go back.
    How can I do it and can it support other languages such as Chinese and Japanese?
    Thanks for help.
    gogo

    Sorry, I made the mistake about the subject, it should be loading local file, not external file through http.
    I wrote a method but it throwed an exception when the midlet was run.
    private void loadText()
    try {
    InputStream is = this.getClass().getResourceAsStream("/text.txt");
    StringBuffer sb = new StringBuffer();
    int chr;
    while ((chr = is.read()) != -1)
    sb.append((char) chr);
    is.close();
    catch (Exception e)
    System.out.println("Error occurs while reading file");
    I put the text.txt file in the same folder with the main file (extends midlet). How can I load the text content and display it on StringItem?
    Thanks for any help.
    gogo

  • Coherence Extend Address-provider for dynamic load balancing

    Hi,
    I want to have load balancing across my proxies. so, trying to use <address-provider> feature.
    Here is my setup,
    I have two proxies and many clients.I am configuring both proxy and the client to use load sharing scheme.
    There are implemented classes for the interface AddressProvider. So, i am going to use that.
    Here is proxy server settings,
    <proxy-scheme>
    <service-name>ExtendTcpProxyService</service-name>
    <thread-count>10</thread-count>
    <acceptor-config>
    <tcp-acceptor>
    <address-provider>
    <class-name>com.tangosol.net.RefreshableAddressProvider</class-name>
    </address-provider>
    </tcp-acceptor>
    </acceptor-config>
    <autostart>true</autostart>
    </proxy-scheme>
    I know there is some silly mistake with that,
    I am getting error message in the following log,
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.emc.srm.common.daemon.SrmDaemon.start(SrmDaemon.java:59)
    ... 5 more
    Caused by: (Wrapped: Missing or inaccessible constructor "com.tangosol.net.RefreshableAddressProvider()"
    <address-provider>
    <class-name>com.tangosol.net.RefreshableAddressProvider</class-name>
    </address-provider>) java.lang.InstantiationException
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
    at com.tangosol.run.xml.XmlHelper.createInstance(XmlHelper.java:2542)
    at com.tangosol.run.xml.XmlHelper.createInstance(XmlHelper.java:2426)
    at com.tangosol.net.ConfigurableAddressProvider.createAddressProvider(ConfigurableAddressProvider.java:277)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.peer.acceptor.TcpAcceptor.configure(TcpAcceptor.CDB:78)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.ProxyService.configure(ProxyService.CDB:67)
    at com.tangosol.coherence.component.util.SafeService.startService(SafeService.CDB:6)
    at com.tangosol.coherence.component.util.SafeService.ensureRunningService(SafeService.CDB:27)
    at com.tangosol.coherence.component.util.SafeService.start(SafeService.CDB:14)
    at com.tangosol.net.DefaultConfigurableCacheFactory.ensureServiceInternal(DefaultConfigurableCacheFactory.java:1057)
    at com.tangosol.net.DefaultConfigurableCacheFactory.ensureService(DefaultConfigurableCacheFactory.java:892)
    at com.tangosol.net.DefaultCacheServer.startServices(DefaultCacheServer.java:81)
    at com.tangosol.net.DefaultCacheServer.intialStartServices(DefaultCacheServer.java:250)
    at com.tangosol.net.DefaultCacheServer.startAndMonitor(DefaultCacheServer.java:55)
    at com.tangosol.net.DefaultCacheServer.main(DefaultCacheServer.java:197)
    ... 10 more
    Caused by: java.lang.InstantiationException
    at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at com.tangosol.util.ClassHelper.newInstance(ClassHelper.java:587)
    at com.tangosol.run.xml.XmlHelper.createInstance(XmlHelper.java:2501)
    ... 23 more
    Cannot start daemon
    First question:
    1) without address provider section in the proxy server configuration xml, will it use any default address provider implementation?
    2) what's wrong with the proxy server settings xml which causes above error?
    Thanks
    Prab

    Hi LuK,
    Sounds like there is no load balancing is happening in my environment.
    I didn't use address provider tag since it's mentioned in AddressProvider Interface API that by default it uses ConfigurableAddressProvider implementation.
    Here is a xml snippet in remote client cache configuration xml,
    <tcp-initiator>
    *<remote-addresses>*
    *<socket-address>*
    *<address>PROXY-A</address>*
    *<port>9099</port>*
    *</socket-address>*
    *<socket-address>*
    *<address>PROXY-B</address>*
    *<port>9099</port>*
    *</socket-address>*
    *</remote-addresses>*
    <connect-timeout>10s</connect-timeout>
    </tcp-initiator>
    what i mean by load balancing is,
    I will be having lot of web service queries which runs very fast. I would like to see both the proxies serves the web requests.
    I am observing, One connection has been made to one proxy when it's starts up and keep hold on to it (no matter whether other proxy is free or not).
    is it a bug? or am i doing some mistake?
    Thanks
    Prab

  • How do I dynamically load a SWF that was compiled from an Fla with a linked external class file

    I am dynamically loading external SWFs in a Main Fla in response to clicks on a menu.
    The loading code is standard and works fine for all of the SWFs except one. When I try to load it I get the following error:
    Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
    I am certain that the URL to the problem SWF is correct. The SWF itself doesn't load any other SWFs or images.
    The problem SWF is linked to an external class file and compiled with it.
    i.e. in the properties panel of the main timeline of the problem SWF's Fla I have entered the path to the external class.
    1. there is no problem compiling this SWF with the class (it works fine by itself)
    2. if I remove the external class from the properties panel and don't use it the resulting SWF imports without a problem into the Main Fla mentioned before
    So the problem seems to be the fact that the external class is linked in the properties panel. Is this a path problem?
    Would appreciate any suggestions,
    Thanks!

    despite what you say, that loaded swf most likely is loading something and that's the cause of the error.
    you could test that by putting the main swf's embedding html file in the same directory with problematic swf.  if the problem is as explained above, you'll have no problem when the main html is in the same directory with the loaded swf.

  • External Text Marquee

    Hi,
    This is the simplest way of loading external text into a
    Dynamic Text Field:
    loadVariablesNum("YourFile.txt", 0);
    Right ...
    Could anyone please tell me what is the simplest way of
    animating it ?
    I need a marquee effect for external text loaded into a
    dynamic text field ...
    Thanks in advance
    Hassan

    OK. I don't think you need to use LoadVariablesNum - although
    I guess that should work (I don't use these anymore I always use
    LoadVars)
    If you see the trace working but nothing displaying then you
    just need to associate you variable with a dynamic text field on
    stage
    Give this a try:
    //testing only... this would normally be set up in the
    external YourFile.txt text file without the quotes (actually I just
    looked at some of the livedocs examples and they used quotes... but
    I don't usually.
    mytext="Lorem ipsum dolor sit amet, consectetur adipisicing
    elit, sed do eiusmod tempor incididunt ut labore et dolore magna
    aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
    laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
    dolor in reprehenderit in voluptate velit esse cillum dolore eu
    fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
    proident, sunt in culpa qui officia deserunt mollit anim id est
    laborum."
    //code on main timeline
    loadVariables("YourFile.txt", this);
    this.onEnterFrame = function() {
    if (mytext=="" || mytext==undefined) return;
    var tmpArr = mytext.split("");
    tmpArr.push(tmpArr.shift());
    mytext= tmpArr.join("")
    trace(mytext);

  • Format for 'content swfs' suitable for ios loading

    I am wondering if this is how content should be embedded into swfs for dynamic loading in ios runtimes?  This all works in air+android.
    package stuffs
    public class stuff extends dataStuff
    [Embed("/minis/mini_1.png")]
    public var m1:Class;
    public static var p:Array = [312,0,2931,3958,35,412,251,2274,3164,204,251,2274,3164];
    Once loaded, I access the images like this:
    var img:Class = (_myApplicationDomain.getDefinition( "stuffs::stuff _m1" ) as Class);
    return new img().bitmapData;
    And  I access the array like this:
    _cls = _loadedSwf.constructor;
    var myArray:Array = _cls[ "p" ];
    Potential problems:
    - embed is the correct way to do this?
    - can i embed arrays of numbers?
    - can I extend a superclass which is loaded in my main app (no logic... really just an abstract class of getters).
    - is this the right way to extract data in iOS?

    >> I noticed that the bug listed for swfs with external actionscript not reloading. Is there an estimated timeframe for this to be fixed?
    Not yet.
    >> Is this a known issue? And if so what can I do to correct?
    No, this is not a known issue. Could you please log a bug, and also provide a test app to reproduce the issue at our end? That woud help.

  • Dynamic User Decision Texts

    1. Is there a way to configure WF for Dynamic user decision texts? Depending on a flag I might want the user to have two decisons like "Accept" or "Reject" or in some cases three decisions like ""Accept" or  "Reject" or "Cancel" or etc etc.
    2. If the above is not possible, can I have maybe 4 fixed User decision texts and dynamically enable or visible them as I need. For example I can have "Accept" or  "Reject" or "Cancel", but I may need on ""Accept" or  "Reject", so make Cancel invisible..Is this possible..
    Thanks a lot in advance..I will award points..
    Amlan

    You need to program the outcomes in the method and handle these in the workflow. The standard user decision step allows you multiple and good thing is you don't need to program anything but just handle it in the workflow.
    Why don't you give it a try and see for yourself?
    Regards
    Ravi

  • Can't find my dynamically loaded VI path

    Hi Folks,
    I wrote a small VI to aid with file paths used for dynamically loaded VIs. It has worked well up until this point, when I tried to use it in a larger project. I can't seem to figure out what's wrong here - I was under the impression that as long as the (called) VI was included in the build, that it should be available from \built.exe\...
    In terms of directory structure, the caller VI is at:
    C:\Projects\LabVIEW\ABES v6.0.1\toplevel_602.vi
    The called VI is in:
    C:\Projects\LabVIEW\ABES v6.0.1\subvis\GUI\preferences\GUI_preferences.vi
    Caller:
    The 'AutoPath' VI:
    Info received when trying to call subvi from BUILT exe:
    Finally, project structure (auto-populating directories) and build spec's:
    What is it that I'm not getting here?
    Thanks for reading,
    Jamie
    v2009 devel. w/RT

    The first example assumes two things:
    There's a folder that has all the plugins.
    The actual plugin VI is included in the build (e.g. by putting it in the Always Included section, as shown below), so it's also placed inside the EXE.
    If this is done, then the "plugins folder" VI shown in my example and the actual plugin VIs keep their relative positions inside the EXE, which is the case the original poster had. In this case, as well as in my second example, you don't have to do anything - LV will automatically place the VI in the correct place INSIDE the EXE.
    I didn't look at your code, but if you're not including the plugin inside the EXE itself, this can become more complicated, because you have to manage all the paths and the dependencies. I suggest you try to avoid doing this unless you must have the ability to add plugins after building the EXE.
    If you do need, try searching around for info on plugin architectures. I believe there's some info in the LV wiki.
    Try to take over the world!

  • Load the External text and css file for more frames

    hello..
           I created one Movie file. In that I load the External text and css file in first frame and display the first variable value in one text box.
    And then in 2nd frame I use another one text field and display the 2nd variable value like that I want to load the more variable in more textboxes with different frames.
         I loaded  for first variable value in first frame. But I don't know how to do next frames like that..
         Help me...

    You need to load them in the frames they are in.  You can store the loaded data in variables in frame 1, but you will need to extend that layer so that whatever is stored is avaliable in other frames.  The code to load the data into the other textfields can then be done in the frames where it is needed.
    There are other options, such as not using other frames for content or having all of them in frame 1 and making them invisible until you get to the other frames where they get turned visible.

  • Trying to dynamically load CSS for project at compile time via config XML file to select CSS file.

    I'm using the same code base to compile different versions of a project. Each project has different base fonts. I've created multiple css files that use the same style names. The idea being that in the code I reference the style names, then the loaded CSS determines which font (and size, color, etc) is used for each style name.
    The CSS files are compiling to SWFs, and those SWFs are referenced in config.xml files. Before compiling, I select the config file to use.
    I am loading the CSS SWF files via the StyleManager in the Application.mxml, like so:
      styleManager.loadStyleDeclarations( _contentData.elements( 'cssPath' ).@path )
    The path traces out correctly as:
    assets_embed/styles/project2.swf
    For some reasone I must include an fx:Style line in the Application.mxml file or no fonts are recognized. Example:
      <fx:Style source="assets_embed/styles/project1.css"/>
    If I reference the css for project one (as done above) then most, but not all, styles work. Some styles reference the fonts from the project 1 css, others properly use fonts from project 2 swf. If I point to the CSS for the project I'm compiling in the <fx:Style > tag then all fonts work, but that defeats the goal of using XML rather than code to identify the styles.
    So, why do I need the fx:Style line if the css is being loaded via StyleManager?
    Why is there "cross talk" between style definitions?
    Is there a better way to select styles at compile time?

    I read this quickly so I might have missed a detail.  I think your describing an issue with recent Flex releases that is described in the fine print somewhere.  If you don't have any fonts embedded in the main app and are only bringing in fonts embedded in CSS SWFs, you have to force-link the EmbeddedFontRegistry by adding something like this to the main app's script block.
    import mx.core.EmbeddedFontRegistry; EmbeddedFontRegistry;
    (Yes, "EmbeddedFontRegistry" is in there twice, once to define the fully qualified name, the other to create a class dependency to force the linking).

  • Compiling a CSS into SWF without merged SDK and dynamically loading

    I have a flex application that is built with the SDK merged in (for my own good reasons). This application dynamically loads a style SWF that was built without the SDK merged. Unfortunately, it seems that the loaded SWF fails to resolve its references with the SDK and gives me a 1014 run-time error.
    If I merge the SDK into the CSS SWF then it works. If I set both my application and the CSS SWF to use the SDK as an RSL then it works. In short the matrix is:
    CSS SWF, SDK merged?
    Application, SDK merged?
    Works?
    Yes
    Yes
    Yes
    Yes
    No
    Yes
    No
    Yes
    No
    No
    No
    Yes
    I do not want a big CSS SWF to dynamically load with all the SDK in it when I already have the SDK loaded with my application. Any help much appreciated.

    Hi,
    In you rsl project properties, go to Flex Library Build Path and go to library path tab. Here you can edit your imported library. There's no need in RSL to import the libraries merge into code but external(even the Adobe libraries should be loaded as external) cause you load it already from your application project (as rsl or merge into code).
    Bye!

Maybe you are looking for

  • XML payload search in Xi messages

    Hi All, I need to get the XML pay load for a message which contains a specific value for a specific field. Also I need to get the XML message ID of this message. Is there any option available in Xi for this purpose? Thanks in advance..

  • Setting content server for storing PPM documents

    Hi Folks, We have followed the steps outlined the PPM config doc for setting up the content server (pages 117). Summary of the steps are shown below. (We are on PPM5.0) Creating a Content Server Entry 1. In Customizing for SAP NetWeaver under Applica

  • Embed a MIME image into a container

    Hi experts, I am trying to create a selection menu that is composed of several images as pushbuttons. I have implemented an initial solution uploading those images using SE78 transaction. But, it has the restriction of using images of a very low qual

  • Where are custom dropzones stored?

    Hi All, I just migrated from my old G5 to a new iMac.  I had a bunch of custom templates and dropzones installed in my version of DVDSP on the G5.  Unfortunately they didn't transfer during the migration.  I'm not quite sure where they are located on

  • NON CUMMULATIVE KEYFIGURE

    hi everybody & kalpana,   i need brief notes regarding Non-Cumulative keyfigure.start routines & update routines.    plz help me in this issue.