Movie refuses to load variables from text file

Hi,
I'm sure you can solve my newbie problem in less than 1
minute...
I'm pulling my hair out on a template I bought 2 days ago
from templatemonster.com
I am using Flash 8 Pro.
All I want to do is change an existing textfield that is
Static to Dynamic and load variables from a text file.
The Action Script I use to do so comes directly from
Macromedia documentation (see attached)
It works fine when I create a brand new movie, but doesn't do
anything when inserted into the template.
It doesn't even complain about not finding the text file if I
rename or delete it!
Here are the FLA and text file:
Edit : Link to source file removed
The textfield I would like to change is in the txt2 symbol.
Here is how I proceed:
When I open HEADER.FLA, Flash tells me I'm missing a font,
ok, so I click on Use Default, I'll deal with this later.
I open up the Movie Explorer, go to Layer 30, go to Frame 75
and click once on txt2
I name the instance "myMovie_mc" and save (converts from
Flash MX to Flash 8)
I double-click on the Movie Clip, select the word
"Automobile" on the Stage, change from Static to Dynamic and call
that instance "myText_txt"
Still in the Movie Clip, I create a new layer I call
"actions", and in Frame 1 I copy the attached Action Script:
This script works when I create a new flash file, but it does
absolutely nothing in this template.
I know I'm doing something wrong, but I wonder what?
Many thanks to any helping soul!
Ferris.

try this:
// Load text as variable and assign it to the
// dynamic text field
var features_lv:LoadVars = new LoadVars();
features_lv.onLoad = onText();
features_lv.load("safetyFeatures.txt");
function onText(success:Boolean) {
if (success) {
myText_txt.text = features_lv.safetyfeatures;
} else {
myText_txt.text = "unable to load text file.";
or this
// Load text as variable and assign it to the
// dynamic text field
var features_lv:LoadVars = new LoadVars();
features_lv.onLoad = function(success) {
if (success) {
myText_txt.text = features_lv.safetyfeatures;
} else {
myText_txt.text = "unable to load text file.";
features_lv.load("safetyFeatures.txt");

Similar Messages

  • CO-PA load data from text file

    Hello
    At present, in our company, we load data from Excel files to CO-PA. Is there any way to load those data to CO-PA from text files ?
    I will be grateful for any suggestions.

    You can create a structure using KEFA, assign the Value fields in KEFB and then use KEFC to upload data against that structure.
    You have various file format options, but I don't think Excel is one of them... you have have to save the file as txt and upload.
    Play around with those transactions and come back if you need additional help.
    Cheers.

  • Unable to find file error while loading data from text file to Oracle

    Hi,
    I am having a interface where i am loading a data of Text file to Oracle.
    But when i am trying to do this i am getting following error.
    ODI-1227: Task SrcSet0 (Loading) fails on the source FILE connection SAPMM.
    Caused By: java.sql.SQLException: File not found: d:/mdb/#General.get_filename
         at com.sunopsis.jdbc.driver.file.FileResultSet.<init>(FileResultSet.java:160)
         at com.sunopsis.jdbc.driver.file.impl.commands.CommandSelect.execute(CommandSelect.java:57)
         at com.sunopsis.jdbc.driver.file.CommandExecutor.executeCommand(CommandExecutor.java:33)
    SAPMM is connection name.
    I am using get_filename to get the filename and it is fetching correct value as the this variable refreshes in previous step of this interface.
    KM used for loading is File to SQL
    What would be cause of this error?
    Thanks,
    Mahesh

    Hi,
    Did a testing and following are the result
    I have
    A> created package having steps like
    1. Declaration of variable v_filename.
    2. Refreshing variable v_filename.
    3. Execution of Interface which gets the file name from v_filename and load into target table
    Package executes successfully.
    B> created package having steps like
    1. Declaration of variable v_filename.
    2. Refreshing variable v_filename.
    3. Scenario of Interface which gets the file name from v_filename and load into target table
    Package executes with erre as it is not able to find the file
    C> created package having steps like
    1. Declaration of variable v_filename.
    2. Refreshing variable v_filename.
    3. Execution of Interface which gets the file name from v_filename and load into target table
    4. Now create a scenario of the package , use the generated scenario in another package say main_package
    Execution of main_package is successful.
    Thanks,
    Sutirtha

  • Loading data from text file into ListBox

    I have data in a text file that I want to load into a
    listbox... I have fully mastered handling strings and arrays so I'm
    going to need some help...
    I was wondering how do I get flash to load a text file that
    contains the data below.. and display it line for line like I want
    it to list down the component
    "Launch;7.1.7.6"
    "Engine;7.1.7.6"
    "OSX;7.0.0.2" (or something close to that)
    and I was wondering how do i just get it to take it fromt he
    file.. line for line from where it says exeversion in the file and
    list it in the listbox...
    I'm really thankful to anybody that helps.
    Data in text file:
    quote:
    exeversion=Launch;7.1.7.6;
    exeversion=Engine;7.1.7.6;
    exeversion=LinuxX86;7.0.0.2;
    exeversion=LinuxPPC;7.0.0.2;
    exeversion=LinuxMIPS;7.0.0.2;
    exeversion=OSX;7.0.0.2;
    exeversion=Config;7.1.7.6;
    exeversion=UI;7.1.7.7;
    exeversion=JAVA;7.0.4.5;

    nobody cna help me? i really need to know or have a tutorial
    or something so i can learn from it... i really appreciate anyone
    who helps

  • Creating Variables From Text File

    Hello a little new to powershell and have banging my head on the wall trying to get this working.
    I have a text file (where the numbers of lines will change everytime) that will contain AD groups. 
    Lets say it looks like this
    GroupA
    GroupB
    GroupC
    I'm trying to you a loop that will read the file and output each new line to a variable so
    var1=GroupA
    Var2 =GroupB
    Var3=Groupc
    My first problem is that non of these can be null since this will be then be used with Add-ADgroupmemeber
    So I have it get the number of items with $Items = get-content *File* | Measure-Object -Line
    After that I have been trying to use a loop which to me looks like it should work however is not. I'm not getting any errors. However I'm not getting any created variables either. 
    For ($i=1; $i -lt $Items.lines; $i++) {
    $var[$i] = (Get-Content *File*)[$i-1]
    write-host $var[$i]}
    In my head I should get a listed of each line of the txt file but I'm getting nothing. 
    In the end I was hoping to doing something along the lines of ADD-Adgroupmember -identity $Var[$i] -members *Machine Name*
    If there is a better way to approach this I'm all ears.
    Thanks for any help!

    You don't need a loop to read each line from the file. You don't need a variable for each group read from the file. 
    For example, if your file looks like:
    GroupA
    GroupB
    GroupC
    with spaces/empty lines in it, that you wish to ignore, you can use:
    $Groups = Get-Content .\groups2.txt | % { ($_.split(" ",[System.StringSplitOptions]::RemoveEmptyEntries)) }
    The $Groups variable will be an array that holds non-empty lines from the file. You can use that directly as in:
    foreach ($Group in (Get-Content .\groups2.txt | % { ($_.split(" ",[System.StringSplitOptions]::RemoveEmptyEntries)) })) {
    Add-ADGroupMember -identity $Group -members *Machine Name*
    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________
    Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx

  • Loading variable from a file in 7.0 Queries

    Hi All,
    When we run BW 3.x queries through RRMX, we get option to load the variables values via import from file means loading the variables values from a file. Do we have this option available in case of 7.0 queries also as 7.0 queries directly run on portal.
    I know via RSRT, i have that option available for 7.0 queries as well.
    Thanks in advance.
    Sumita.

    Hi,
       Please check out this link. They are requesting to use patch level 14 to the SAP front end.
    Re: Clipboard option in BI7
    Hope this helps for you.
    Thanks,
    Arun.

  • Loading Variable from a file in BI 7.0 queries

    Hi All,
    When we run BW 3.x queries through RRMX, we get option to load the variables values via import from file means loading the variables values from a file. Do we have this option available in case of 7.0 queries also as 7.0 queries directly run on portal.
    I know via RSRT, i have that option available for 7.0 queries as well.
    Thanks in advance.
    Sumita.

    Hi,
    In 7.0 it is not possible to load directly from a flat file when you run the query in the portal. However, I don't think it was an option in 3.x either. In het analyzer, both 3.x and 7.0 have that option, only the copy paste functionallity is gone in 7.0, you have to use a flatfile now. Also, in 7.0 portal you can add indivual values for a variable sperated by a ; sign. So you can use excel to create a ; seperated csv file and copy and paste from that.
    Kind regards,
    Alex

  • Remove duplicates while loading data from text file

    Hi,
    Data in text file (some times has duplicates) is being loaded into Oracle 9i database using Informatica. To improve performance, we would like to remove duplicates at the time of each load using Oracle procedure. Could you please help me with this?
    Thanks,
    Lakshmi

    No, our table doesn't have that. Most of the functionality is managed at the informatica level. Is there any other way? Thanks,

  • How to load variables from a .txt file

    Hi.
    I usually make a flash aplication in colaboration with a php
    programmer. But i want to test my swfs without having to wait for
    him. So i want to do that through a text file. I know that flash
    can load variables from text files. The problem is i don't know how
    to format the text file ( example.txt).
    Thank you

    Here's a couple of ideas.
    First you probably want to change what you have...and put
    your 'if (pVar==1' etc inside a separate function and call it from
    the onLoad handler after you have assigned the value to pVar...
    because the onLoad will run at some unknown point in time after
    loading has finished (actually in the test environment this might
    work... but that wouldn't be the same as what happens in a
    production setting).
    To create test files for loadvars... simply create a new as2
    file and put this code on the first frame and test movie:

  • Dynamically load content into a "template" swf from text file

    I have a dream....
    Well, I have a concept. I have not actively pursued Flash in
    several years, though I've continued to have it in my arsenal. I've
    not done much in the action scripting realm for a while though.
    I am trying to create a template that will be used for about
    100 different product pages.
    It would have two tabs, basically, 2 different graphical
    button sets. One will have up to 4 links to similar products, each
    tab will be on the side of a square, and I need the ability to not
    display a tab if there is no actual link.
    As for the other tab, Its a menu that consists of a series of
    lines. This can be an external menu, I just need a way to have
    flash load the right menu. This menu, when you mouse over a line,
    the name of the product appears, as well as a product image that
    gets loaded with the menu. The product images would be external,
    allowing me to simply replace an image if a new higher end version
    of the product comes out.
    So, I am totally not an actionscripter. Looks like I need to
    load variables from an external file. Can I set a property in the
    flash code on the html that tells the movie what dataset to grab
    from?
    Here's basically what I am looking for
    property: value
    (load variables for:)
    item: 44
    (menu1)
    faster: 54b.html
    slower: 34d.html
    left: 43d.html
    right: 45c.html
    (menu2)
    menu:graph5.swf
    (menu loads images from external source)
    link51: 51d.html
    link52: 52c.html
    link53: 53c.html
    link54: 54d.html
    link55: 55b.html
    link56: 56d.html
    A possible third menu would be text driven, and would use
    html to link to various items.
    This is a static site, so urls will be fixed.
    Is it best to build a php page that serves up data for a
    single item, or do one big text file with all 100 or so items? Is
    that even possible?
    My Flash since MX is very rusty. I am using Flash Pro8. I
    would love to create a single file so modifications are to the text
    files, unless a new item is released, then it's updating a single
    flash menu and updating the text file.
    Been spending way too much time in InDesign lately! I used to
    be pretty good at Flash!

    well sorry there fanmap - but I don't think you're going to
    be able to get this to work. here's why: the link points to a php
    file - which gathers dynamic info from a DB - the return from the
    php is generating a string that is based on the DOM and
    'constructs' a javascript method that in turn writes to the html
    document. although we can embed html into a textField in Flash
    there are a limited number of supported html tags - and JS methods
    will not operate internally. in addition, (i'm not certain someone
    correct this if i'm off) there's no way to 'change' the output of
    the php call, therefore you will not be able to read the return
    because it is designed to use the DOM and write solely to the
    current document. Even if you were to access the JS method from the
    swf file (which one can) it will still only write the content of
    the php return to the html document - and the output is not
    compatible with the textField class.

  • How to load date and time from text file to oracle table through sqlloader

    hi friends
    i need you to show me what i miss to load date and time from text file to oracle table through sqlloader
    this is my data in this path (c:\external\my_data.txt)
    7369,SMITH,17-NOV-81,09:14:04,CLERK,20
    7499,ALLEN,01-MAY-81,17:06:08,SALESMAN,30
    7521,WARD,09-JUN-81,17:06:30,SALESMAN,30
    7566,JONES,02-APR-81,09:24:10,MANAGER,20
    7654,MARTIN,28-SEP-81,17:24:10,SALESMAN,30my table in database emp2
    create table emp2 (empno number,
                      ename varchar2(20),
                      hiredate date,
                      etime date,
                      ejob varchar2(20),
                      deptno number);the control file code in this path (c:\external\ctrl.ctl)
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>any help i greatly appreciated
    thanks
    Edited by: user10947262 on May 31, 2010 9:47 AM

    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)Try
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime "to_date(:etime,'hh24:mi:ss')", ejob, deptno)
    this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>
    That's not an error, you can see errors within log and bad files.

  • Load Multiple Dynamic Text Files in Different frames on Maintimeline

    Hello!
    I have managed to load an external text file in one place one the maintimeline. I would like to do the same thing on other frames. When I go to duplicate the same thing that I did on the first one I get a duplicate textReq request. Do I need to give the textReq a more specific name for each section? When I did this the movie wouldn't even recognize and of the code that was working before.
    Can anyone help me with this code? Thanks in advance
    I am attaching link so you can see sections I am talking about. Also you will notice that the swf file I loaded won't go away. That's another problem...ugh.
    Here is link:
    http://www.sandraschmitt.com/coclico/index100.html
    Here is code on maintimeline:
    stop();
    import fl.transitions.*;
    import fl.transitions.easing.*;
    import flash.net.URLRequest;
    import flash.display.Loader;
    import flash.events.Event;
    import flash.events.ProgressEvent;
    function startLoad() {
        var swfLoader:Loader = new Loader();
        var swfRequest:URLRequest = new URLRequest("endlessCoclico3.swf");
        swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
        swfLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
        swfLoader.load(swfRequest);
    function onCompleteHandler(loadEvent:Event) {
        addChild(loadEvent.currentTarget.content);
    function onProgressHandler(swfProgress:ProgressEvent) {
        var percent:Number = swfProgress.bytesLoaded/swfProgress.bytesTotal;
        trace(percent);
    startLoad();
    //handle events for buttons...
    collections.addEventListener(MouseEvent.CLICK, clickSection);
    raison.addEventListener(MouseEvent.CLICK, clickSection);
    stores.addEventListener(MouseEvent.CLICK, clickSection);
    news.addEventListener(MouseEvent.CLICK, clickSection);
    contact.addEventListener(MouseEvent.CLICK, clickSection);
    home.addEventListener(MouseEvent.CLICK, clickSection);
    function clickSection(evtObj:MouseEvent) {
        //trace shows what's happening... in the output window
        trace("The "+evtObj.target.name+" button was clicked!");
        //go to the section clicked on...
        gotoAndStop(evtObj.target.name);
    Here is code on actual frame where the dynamic text is working:
    //Loaded exteranl text fields
    var textLoader:URLLoader = new URLLoader();
    var textReq:URLRequest = new URLRequest("text_philosophy.txt");
    function textLoaded(event:Event):void {
        philosophy_txt.text = textLoader.data;
    textLoader.load(textReq);
    textLoader.addEventListener(Event.COMPLETE, textLoaded);

    Textfields:  What I like to do, mainly for peace of mind, is to have a layer that I dedicate to actionscript that only has code in frame 1 but it extends the full length of the timeline so that this code is available to every frame on any other layer.  In this frame I put variables and functions that can get used/shared wherever they happen to be needed.  I usually create another separate layer for actions types of actionscript... stuff that happens at the local frame level, like stop();, or like assigning a variable a new value, etc... things local to being at that frame/location.  So with that in mind
    In frame 1 on my shared-by-everyone layer, I'd probably declare the variable....
    var textReq:URLRequest;
    And when I get to a particular frame where I want to load a new textfield with data, I assign that var its value on the local actions layer...
    textReq = new URLRequest("text_philosophy.txt");
    along with the rest of the local execution regarding loading the file, etc...
    SWF's:
    Yeah, pretty much, and it becomes an object that has a home on the timeline, so if you move away from that frame the swf doesn't follow.

  • Load variables from XML into Flash

    I was wondering how to load variables from an XML document to
    a Flash file? I am familiar with the code to do it for a text file,
    but was wondering how to do it for XML.
    Many thanks in advance!
    JJ

    Thanks for the recommendation on the site. What I am trying
    to do is load varaibles from an XML file into text boxes in my
    flash movie.
    Here is my loading:
    var my_xml = new XML();
    my_xml.ignoreWhite = true;
    my_xml.onLoad = function(success){
    if (success) {
    gotoAndStop("slide01");
    my_xml.load("narration.xml");
    this is what I have on my frame with the text boxes (the text
    boxes are also have the variable name in the variable area)
    var narration = my_xml.picture01;
    var my_title = my_xml.my_title;
    var my_date = my_xml.my_date;
    should I do my_date.text = my_xml.my_date; instead?
    my xml doc looks like this
    <?xml version="1.0" encoding="iso-8859-1"?>
    <picture01>This is the text for picture
    01</picture01>
    <picture02>This is the text for picture
    02</picture02>
    <my_title>Las Vegas</my_title>
    <my_date>October</my_date>
    Any help on this would be GREATLY appreciated!
    Text
    my_date.text = my_xml.my_date;

  • LabVIEW for ARM 2009 Read from text file bug

    Hello,
    If you use the read from text file vi for reading text files from a sdcard there is a bug when you select the option "read lines"
    you cannot select how many lines you want to read, it always reads the whole file, which cause a memory fault if you read big files!
    I fixed this in the code (but the software doesn't recognize a EOF anymore..) in CCGByteStreamFileSupport.c
    at row 709 the memory is allocated but it tries to allocate to much (since u only want to read lines).
    looking at the codes it looks like it supposed to allocated 256 for a string:
    Boolean bReadEntireLine = (linemode && (cnt == 0)); 
    if(bReadEntireLine && !cnt) {
      cnt = BUFINCR;    //BUFINCR=256
    but cnt is never false since if you select read lines this is the size of the file!
    the variable linemode is also the size of the file.. STRANGE!
    my solution:
    Boolean bReadEntireLine = (linemode && (cnt > 0));  // ==
     if(bReadEntireLine) {    //if(bReadEntireLine && !cnt) {
      cnt = BUFINCR;
    and now the read line option does work, and reads one line until he sees CR or LF or if the count of 256 is done.
    maybe the code is good but the data link of the vi's to the variables may be not, (cnt and linemode are the size of the file!)
    count should be the number of lines, like chars in char mode.
    linemode should be 0 or 1.
    Hope someone can fix this in the new version!
    greets,
    Wouter
    Wouter.
    "LabVIEW for ARM guru and bug destroyer"

    I have another solution, the EOF works with this one.
    the cnt is the bytes that are not read yet, so the first time it tries to read (and allocate 4 MB).
    you only want to say that if it's in line mode and cnt > 256 (BUFINCR) cnt = BUFINCR
    the next time cnt is the value of the bytes that are not read yet, so the old value minus the line (until CR LF) or if cnt (256) is reached.
    with this solution the program does not try to allocate the whole file but for the max of 256.
    in CCGByteStreamFileSupprt.c row 705
     if(linemode && (cnt>BUFINCR)){
       cnt = BUFINCR;
    don't use the count input when using the vi in line mode. count does not make sense, cnt will be the total file size. also the output will be an array.
    linemode seems to be the value of the file size but I checked this and it is just 0 or 1, so this is good
    update: damn it doesn't work!
    Wouter.
    "LabVIEW for ARM guru and bug destroyer"

  • Cant get data from text file to print into Jtable

    Instead of doing JDBC i am using text file as database. I cant get data from text file to print into JTable when i click find button. Goal is to find a record and print that record only, but for now i am trying to print all the records. Once i get that i will change my code to search desired record and print it. when i click the find button nothing happens. Can you please take a look at my code, dbTest() method. thanks.
    void dbTest() {
    DataInputStream dis = null;
    String dbRecord = null;
    String hold;
    try {
    File f = new File("customer.txt");
    FileInputStream fis = new FileInputStream(f);
    BufferedInputStream bis = new BufferedInputStream(fis);
    dis = new DataInputStream(bis);
    Vector dataVector = new Vector();
    Vector headVector = new Vector(2);
    Vector row = new Vector();
    // read the record of the text database
    while ( (dbRecord = dis.readLine()) != null) {
    StringTokenizer st = new StringTokenizer(dbRecord, ",");
    while (st.hasMoreTokens()) {
    row.addElement(st.nextToken());
    System.out.println("Inside nested loop: " + row);
    System.out.println("inside loop: " + row);
    dataVector.addElement(row);
    System.out.println("outside loop: " + row);
    headVector.addElement("Title");
    headVector.addElement("Type");
    dataTable = new JTable(dataVector, headVector);
    dataTableScrollPane.setViewportView(dataTable);
    } catch (IOException e) {
    // catch io errors from FileInputStream or readLine()
    System.out.println("Uh oh, got an IOException error!" + e.getMessage());
    } finally {
    // if the file opened okay, make sure we close it
    if (dis != null) {
    try {
    dis.close();
    } catch (IOException ioe) {
    } // end if
    } // end finally
    } // end dbTest

    Here's a thread that loads a text file into a JTable:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=315172
    And my reply in this thread shows how you can use a text file as a simple database:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=342380

Maybe you are looking for