Write my dynamic text variable

It may seem like a very easy noob question but I am writing a variable 'gcouter' in my dynamic textfield.

I am converting it to a string, but still nothing appears in the TextField. Don't know what I'm doing wrong? Could someone please check my code and highlight the "blindingly obvious: I don't see right now?

BTW I outsourced not my script/classes as its been a while since I did it and I'm still thinking a calendar like AS2 so please forgive this part. The project timeline is quite short and I lost a lot of time trying to make it work with as files and document classes.

Here is the code (it's for a single click to your game and use gcounter should be obvious):

import flash.events.MouseEvent;

Stop();

var gcounter:int = 0;

noHelmet.addEventListener (MouseEvent.CLICK, helmetHazard);

shoelaces.addEventListener (MouseEvent.CLICK, shoelacesHazard);

catapult.addEventListener (MouseEvent.CLICK, catapultHazard);

balance.addEventListener (MouseEvent.CLICK, balanceHazard);

check_btn.addEventListener (MouseEvent.CLICK, checkTandem);

scorePanel.visible = false;

function helmetHazard(event:MouseEvent):void

{

trace ("you have found the danger of helmet");

gcounter ++;

trace (gcounter);

noHelmet.removeEventListener (MouseEvent.CLICK, helmetHazard);

}

function shoelacesHazard(event:MouseEvent):void

{

trace ("you have found the danger of laces");

gcounter ++;

trace (gcounter);

shoelaces.removeEventListener (MouseEvent.CLICK, shoelacesHazard);

}

function catapultHazard(event:MouseEvent):void

{

trace ("you have found the danger of Catapult");

gcounter ++;

trace (gcounter);

catapult.removeEventListener (MouseEvent.CLICK, catapultHazard);

}

function balanceHazard(event:MouseEvent):void

{

trace ("you have found the danger of Catapult");

gcounter ++;

trace (gcounter);

balance.removeEventListener (MouseEvent.CLICK, balanceHazard);

}

function checkTandem(event:MouseEvent):void

{

trace (gcounter);

If (gcounter == 0)

{

feedback. Play();

}

ElseIf (gcounter == 4)

{

feedback.gotoAndPlay (30);

MovieClip (this.parent).nextBtn.alpha = 1;

MovieClip (this.parent).nextBtn.mouseEnabled = true;

}

on the other

{

feedback.gotoAndPlay (15);

scorePanel.visible = true;

String (gcounter);

scorePanel.score.text = String (gcounter);

trace (gcounter);

}

}

Thanks in advance!

is scorePanel.score your textfield?  If so, your trace() runs after you assign text to scorePanel.score?  If so, incorporate your policy, make sure the color of the font is different from the background color of textfield and make sure your textfield has enough width/height of this text view.

Tags: Adobe Animate

Similar Questions

  • Created way dynamic text Variable movie

    I created dynamically a clip that has a text box for it, but I can't get the text variable is displayed in the text box of the item.

    Here is my code. I wonder what I'm doing wrong? Any help would be greatly appreciated.

    I actually thought about it. I had a mental breakthrough when I posted it. I moved the

    pScenario.scenario_txt.htmlText = myScenario; After that, I added the mc at the scene. Works fine now!

  • Dynamic text variables

    If I have a dynamic textfield with text loaded from .txt file is possible, and if so, how to use variables supported in the text is to say:

    "It is the text in the dynamic text field that is loaded from something.txt, you watched XVAR times"

    Where XVAR is another variable?

    Yes and

    my_tf. Text = "This is the text in the dynamic text field which is responsible of" + somethingPath + ", you watched '+ XVAR' time'"

  • Problem of passing a variable to a field of dynamic text in php (Flash 8)

    I am currently working on a flash file, where a person enters
    their score in a box of text entry with an instance name of score, then it
    It converts a percentage and ranks.
    The swf file displays the rank and the percentage in two dynamic text boxes
    with the name of the instances of percent and score.
    This part is for me no problem.
    The main goal is to pass the percent and the partition to a php file called
    grade.php and save the two variables in MySQL.

    After you download the files to a server, I run the swf file and
    It seems that everything works.  But when
    I check the MySQL file, I noticed that a row has been inserted, but no score or
    grade entered.   I can't know
    What is the problem.  If anyone can help
    me with that?

    Here the Actionscript 2.0 code and the php file:

    function findPercent() {}

    percent. Text = (score.text * 100) / 100;

    If (percent.text > = 90) {}

    rank. Text = "A";

    } ElseIf (percent.text < 90 & & percent.text > = 80) {}

    rank. Text = "B";

    other
    If (percent.text < 80 & & percent.text > = 70) {}

    grade.text = 'C ';

    } ElseIf (percent.text < 70 & & percent.text > = 60) {}

    rank. Text = "D";

    } ElseIf (percent.text < 60) {}

    rank. Text = 'F';

    }

    }

    submit_button.onRelease = function() {}

    submitURL = "grade.php";

    Create an instance of the LoadVars object and fill it.

    send_lv = new LoadVars();

    send_lv.score = "percent.text";    (Note: when I used the text of entry as. score.text box, it displays in MySQL)

    send_lv.grade = "grade.text";

    send_lv. Send (submitURL, "POST");

    };

    (grade.php)

    < html >

    < head >

    < title > Grades: add your rank and Score < /title >

    < / head >

    < body >

    Grade display < h2 > < / h2 >

    <? PHP

    require_once ('connectvars.php');

    Connect to the database

    $dbc = mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);

    Enter the data in the partition of the POST

    $score = $_POST ['mark'];

    $grade = $_POST ['category'];

    Write the data to the database

    $query = "INSERT INTO transcription (score, rank) VALUES ('$score', '$grade');

    mysqli_query ($DBC, $Query);

    mysqli_close ($DBC);

    ? >

    < hr / >

    < / body >

    < / html >

    If you use such track suggested in the message 4 instructions and the instructions of tracing corresponding to your expectations, the problem will be in your php file.

    I have a problem with your php code, but there is no way (in this forum) to check if your db columns are score and rank and that they have the correct data type.

    p.s. I don't download and fix the files unless I'm hired.  free help I offer only via the adobe forums.

  • Create a link using dynamic text and Capture of Variable

    I'm building a dynamic website with Dreamweaver CS5 with Coldfusion 9

    Currently, I created an array of dynamic text. The table is created by querying the invoice table and displays all of the invoices customers. The columns Include invoice #, Date, amount paid, BalanceRemaining, Expiration Date. So, basically lists all invoices that I made a request to the unique customer. It is pulled up using a session variable, that I created from the login page.

    My question is I want to do the # "Bill" when you click on it it goes to a new page and executes a query that retrieves infro associated with this specific invoice such as Services rendered, the Description of Service, Date, price, Total. I was able to create a link to the invoice # but I'm stuck trying to figure out how to capture the Unique invoice # and apply it to the new query. Is it possible if yes, how?

    Thanks for your help!

    < cflock scope = "Session" type = "ReadOnly" timeout = "30" throwontimeout = "no" >

    < cfset MM_Username = Iif (IsDefined("Session.MM_Username"), "Session.MM_Username", DE("")) >

    < cfset MM_UserAuthorization = Iif (IsDefined ("Session.MM_UserAuthorization"), "Session.MM_UserAuthor-ization", DE("")) >

    < / cflock >

    < cfif MM_Username EQ "" EQ MM_UserAuthorization or "" or ListFind("User,Admin",MM_UserAuthorization) EQ 0 >

    < cfset MM_referer = CGI. SCRIPT_NAME >

    < cfif CGI. QUERY_STRING NEQ "" > "".

    < cfset MM_referer = MM_referer & "?" & CGI. QUERY_STRING >

    < / cfif >

    < cfset MM_failureURL = "" sorry.cfm? accessdenied = "and URLEncodedFormat (MM_referer) >"

    < cflocation url = "' #MM_failureURL # ' addtoken ="no">"

    < / cfif >

    < cfparam name = default "PageNum_Invoice" = "1" >

    < cfset GetFileFromPath = CurrentPage (GetBaseTemplatePath ()) >

    < cfparam name = default "PageNum_Query_Invoice" = "1" >

    < cfquery name = "Query_Invoice" datasource = "SBC" >

    SELECT DueDate, AppliedAmount, RefNumber, BalanceRemaining, TxnDate

    OF the invoice

    WHERE CustomerRefFullName = < cfoutput > ' #Session.FullName # ' < / cfoutput >

    < / cfquery >

    < cfset MaxRows_Query_Invoice = 10 >

    < cfset StartRow_Query_Invoice = Min ((PageNum_Query_Invoice-1) * MaxRows_Query_Invoice + 1, Max (voice of Query_In.) RecordCount, 1)) >

    < cfset EndRow_Query_Invoice = Min (StartRow_Query_Invoice + MaxRows_Query_Invoice-1, Query_Invoice.Rec ordCount) >

    < cfset TotalPages_Query_Invoice = Ceiling(Query_Invoice.RecordCount/MaxRows_Query_Invoice) >

    < cflock scope = "Session" timeout = "30" type = "Exclusive" >

    <! - Session variable for invoice reference number - >

    < cfset Session.RefNumber = Query_Invoice.RefNumber [1] >

    < / cflock >

    < cfset QueryString_Query_Invoice = Iif (CGI. QUERY_STRING NEQ "", FROM ('&' & XMLFormat (CGI.) (QUERY_STRING)), de("")) >

    < cfset tempPos = ListContainsNoCase (QueryString_Query_Invoice, "PageNum_Query_Invoice =", "&") >

    < cfif tempPos NEQ 0 >

    < cfset QueryString_Query_Invoice = ListDeleteAt (QueryString_Query_Invoice, tempPos, "&") >

    < / cfif >

    < ! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional / / IN" "http://www.w3.org/TR/html4/loose.dtd" > ""

    "< html > <!-InstanceBegin template="/Templates/customer_template.dwt.cfm ' codeOutsideHTMLIsLocked = 'false'->

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; charset = utf-8 ">"

    <!-InstanceBeginEditable name = "title"--> < title > Untitled Document < / title > <! - InstanceEndEditable - >

    < link href = "styles/Main.css' rel ="stylesheet"type =" text/css">"

    < script src = "SpryAssets/SpryMenuBar.js" type = "text/javascript" > < / script > "

    < link href = "SpryAssets/SpryMenuBarHorizontal.css" rel = "stylesheet" type = "text/css" > "

    <!-InstanceBeginEditable name = 'head'-> head content goes here <! - InstanceEndEditable - > < / head >

    < body >

    < div id = "Container" >

    < div id = "header" > < img src = "Images/site Web - Image.gif" width = "393" height = "217" alt = "TS planning landscaping Logo and company name" > < / div >

    < div id = "menu_bar1" >

    < ul id = "MenuBar1" class = "MenuBarHorizontal" >

    < li > < a class = "MenuBarItemSubmenu" href = "index.cfm" > home < /a >

    < ul >

    < li > < a href = "#" > 1.1 < /a > < /li >

    < li > < a href = "#" > 1.2 < /a > < /li >

    < li > < a href = "#" > question 1.3 < /a > < /li >

    < /ul >

    < /li >

    < li > < a href = "#" > about us < /a > < /li >

    < li > < a href = "#" > Services < /a > < /li >

    < li > < a class = "MenuBarItemSubmenu" href = "#" > user account < /a >

    < ul >

    < li > < a href = "login.cfm" > Connect < /a > < /li >

    < li > < a href = "registration_page_contact.cfm" > register < /a > < /li > "

    < li > < a href = "members_page.cfm" > customer Page < /a > < /li > ""

    < /ul >

    < /li >

    < li > < a href = "#" > contact us < /a > < /li >

    < /ul >

    < / div >

    < div id = 'Hand' >

    < div id = "side_bar" > <!-InstanceBeginEditable name = "sidebar"-> content for id "side_bar" goes here <! - InstanceEndEditable - > < / div >

    < div id = "main_body" > <!-InstanceBeginEditable name = "mainbody"->

    < H1 > < cfoutput > #Session.FullName # < / cfoutput > bills < / h1 >

    < p > here you can view your bills current and past. < /p > < br >

    < name of the form = "customerinvoices" >

    < table border = "1" align = "center" >

    < b >

    < td > < div align = "center" > invoice # < / div > < table >

    < td > < div align = "center" > Date < / div > < table >

    paid < td > < div align = "center" > < / div > < table >

    < td > < div align = "center" > BalanceRemaining < / div > < table >

    Due Date < td > < div align = "center" > < / div > < table >

    < /tr >

    < cfoutput query = "Query_Invoice" StartRowOptional = "" #StartRow_Query_Invoice # "LignesMax =" #MaxRows_Query_Invoice #">"

    < b >

    < td > < a href = "invoice_number_page.cfm" > #Query_Invoice.RefNumber # < /a > < table >

    < td > #LSDateFormat (Query_Invoice.TxnDate, 'MMMM DD, YYYY') # < table >

    < td > #DollarFormat (Query_Invoice.AppliedAmount) # < table >

    < td > #DollarFormat (Query_Invoice.BalanceRemaining) # < table >

    < td > #LSDateFormat (Query_Invoice.DueDate, "MMMM DD, YYY'") # < table >

    < /tr >

    < / cfoutput >

    < / table > < / make >

    < p > < table border = "0" align = "center" >

    < cfoutput >

    < b >

    < td > < cfif PageNum_Query_Invoice GT 1 >

    < a href = "#CurrentPage #?" PageNum_Query_Invoice = 1 #QueryString_Query_Invoice #"> first < /a >"

    < cfelse > sorry no bills have been found!

    < / cfif > < table >

    < td > < cfif PageNum_Query_Invoice GT 1 >

    < a href = "#CurrentPage #?" PageNum_Query_Invoice = #Max (DecrementValue (PageNum_Query_Invoice), 1) # QueryString_Query_Invoice #"> back < /a >"

    < / cfif > < table >

    < td > < cfif PageNum_Query_Invoice LT TotalPages_Query_Invoice >

    < a href = "#CurrentPage #?" "PageNum_Query_Invoice = #Min (IncrementValue (PageNum_Query_Invoice), Tota lPages_Query_Invoice) # QueryString_Query_Invoice # ' > next < /a >

    < / cfif > < table >

    < td > < cfif PageNum_Query_Invoice LT TotalPages_Query_Invoice >

    < a href = "#CurrentPage #?" PageNum_Query_Invoice = #TotalPages_Query_Invoice # QueryString_Query_In voice #"> last < /a >"

    < / cfif > < table >

    < /tr >

    < / cfoutput >

    < table / > < / p >

    <! - InstanceEndEditable - > < / div >

    < / div >

    < div id = "footer" >

    < p > home | Who are we | < /P > site map

    < p > & copy; TS in planning landscaping LLC 2010 < /p >

    < / div >

    < / div >

    < script type = "text/javascript" >

    var MenuBar1 = new Spry.Widget.MenuBar ("MenuBar1", {imgDown: "..."}) "" / SpryAssets/SpryMenuBarDownHover.gif ', imgRight: ".. ({"/ SpryAssets/SpryMenuBarRightHover.gif"});

    < /script >

    < / body >

    <! - InstanceEnd - > < / html >

    Without trying to sift through all the code has nothing to do with the question, I think you want to do something like this:

    Select number, Word

    etc.

    #word #.

    Then on nextpage.cfm, your variable will be url.thenumber.

  • Variables and dynamic text fields

    OK, so I'm a complete dunce, but I only use Flash for a few days so please be patient with me.

    All I want to do is a dynamic text field to view a variable using Actionscript. The code is below, but it won't work. Can someone please advise? I have to use LoadVars? I thought it was just for the external data.

    just a little mistake

    var myValue:String = "text to display";
    This.icon_mc.icon_txt. Text = myValue;

  • Targeting the area of dynamic text inside the moviecip to the variable

    Hello

    How we don't target a dynamic text box to change the color of the border within a clip? Example below is not working

    theName = ("answerPrint" + arryCount);
    boxName = ("box" (arryCount + 1));

    _root.pagePrintPartA [theName] [boxName]. Border = true;
    _root.pagePrintPartA [theName] [boxName]. BorderColor = 0x00cc66;

    Thanks for the backup, but I should of stated what was that that:

    theName = ("answerPrint" + arryCount) ;// Variable name within the area of dynamic text inside MovieClip
    boxName = ("box" + (arryCount + 1)) ;// Instance name of real dynamic text box inside MovieClip
    _root.pagePrintPartA [theName] [boxName]. Border = true;
    _root.pagePrintPartA [theName] [boxName]. BorderColor = 0xFF0000;

    In certifying this script you showed me where I went wron (do not see the forest for the trees). The last two lines should be:

    _root.pagePrintPartA [boxName]. Border = true;
    _root.pagePrintPartA [boxName]. BorderColor = 0xFF0000;

    I was aiming for back. Thank you very much DazFaz.

  • changing flex inf flash dynamic text field?

    Hello

    I am developing a game in flex builder and I had a problem with dynamic text that I imported from flash. I want to insert a dashboard in my application and to do this, I use a dynamic text in flash. I create a dynamic text in flash, then an import to Flash Builder in a clip, and I called the dynamic text "Score." Now, I tried to use the variable 'Score' to change the value of the dynamic text box UN my flash builder application, but it doesn't change anything.

    I read somewhere that I learned to use the value of score.text to change the number of my points, but that does not work because Flash Builder tells me that this kind of variable contains the value .text.

    Thanks for trying to help me.

    Download the source of TinkSpark to http://code.google.com/p/tink/source/checkout and add the package to your project:

    Then write the following code:

    Import ws.tink.core.Library;
    Import ws.tink.events.LibraryEvent;
    Import ws.tink.managers.LibraryManager;

    private void loadLibrary (): void

    {

    Library: library of var = LibraryManager.libraryManager.createLibrary ("assetsLibrary");
    library.addEventListener (LibraryEvent.LOAD_COMPLETE, onAssetsLibraryLoadCompleteHandler, false, 0, true);
    library.loadSWF ("board.swf"); Specify the path to board.swf, pls, note board.swf is then exported as AS3.0
    }

    private function onAssetsLibraryLoadCompleteHandler (event: LibraryEvent): void
    {
    EventDispatcher (event.currentTarget) .removeEventListener (event.type, arguments.callee);
    Library: library of var = LibraryManager.libraryManager.getLibrary ("assetsLibrary");

    var AssetScore: Class = library.getDefinition ("Score");
    var Note: * = new AssetScore() as Sprite;
    score.scoreDisplay.text = "100";
    addChild (score);
    }

    Best regards

    Etienne Das

    http://deepanjandas.WordPress.com/

  • dynamic text don't show some characters

    Hi guys,.
    I have a problem... I have a dynamic text in my flash and it's reading a txt vars file, but it does not read some Portuguese characters like c C or accents such as a a  Â...
    I tried to embendding theses characters on my dynamic text, choose to integrate > all and it does not work... I already tried to write them on the text box and add > AutoFill, but it still works!
    am I missing something? help me, please!

    Well the characters you mentioned must be both more regular fonts. They are just exotic enough to justify a full unicode font. I'm guessing that touches something else. Of course that depends on what the font you're using. But most of the fonts that come with a computer and a regular software should have these characters.

    You mention that you read the vars from a txt file. Try this in the test environment. Test publish your FLA and once the text file has been read go up to the menu debug and list Variables. Some place it should be the content of the text file. The characters display correctly there?

    If they are not, then the problem is that Flash is not properly read the text file and no police will be able to fix this. Be sure you save your file as UTF-8 text. Flash does not play so well with the other formats and beyond the range of basic ASCII text files.

    If they appear correctly in the Variables from the list. Then you know that the problem is with your fonts. As I said most of the fonts should have these characters so after back if you need assistance.

  • Load the Image of the URL entered in the dynamic text box

    I have an area of dynamic text (image_in) to receive a URL entry of an image to be loaded into a clip (peak) when you press a button (b_load).

    I can't make it work, the code seems pretty simple:

    var image_url:String = image_in.text;

    b_load.addEventListener (MouseEvent.CLICK, Load_URL);

    function Load_URL(event:MouseEvent):void

    {

    var i = new Loader();

    i.Load (new URLRequest (image_url));

    pic.addChild (i)

    }

    This code gives me: #2044 Error: Unhandled IOErrorEvent:. Text = Error #2035: URL not found.

    This code works when I declare the var as a URL:

    var image_url:String = " " http://website.com/image.jpg ";


    What is the difference if I go http://website.com/image.jpg in the dynamic text field? What's wrong?

    Any help would be appreciated, thanks!


    You declare the image_url variable after the dynamic text? If this isn't the case, then the value of this variable will be an empty string. Set the variable inside the function declaration, and it should work as expected.

  • [AS] set Applescript variable to a value of a text variable

    Hello.

    I have a script that sets a text variable in the active document like this:

    say application "Adobe InDesign CS6.

    set myDoc for the active document

    say myDoc

    try

    set myOrdrenummerTxt to do new variable text with thenameof properties {: 'lowRes_DPI'}

    end try

    try

    set content of the variable of myOrdrenummerTxt options to '72'

    end try

    end say

    end say

    I need to write a new script that uses the variable text stored data.

    How can I (with Applescript) store the new value in an Applescript variable?

    I guess something like that, but it does not work:

    say application "Adobe InDesign CS6.

    set myDoc for the active document

    say myDoc

    the value lowRes_DPI to content of the variables options of 'LowRes_DPI '.

    end say

    end say

    Hi David,

    You forgot the variable text

    say application "Adobe InDesign CS6.

    set myDoc to the active document

    myDoc say

    the value lowRes_DPI to content of variable options of variable text "LowRes_DPI".

    end say

    end say

    Concerning

  • View of dynamic text in an xml file

    I'm looking to display dynamic text in an external xml file. When I trace for the variable, all is well in the output window. But the text does not appear in the published movie.

    Here is my current code:

    var myXML:XML;
    var myLoader:URLLoader = new URLLoader();
    myLoader.load (new URLRequest ("AskAnExpert.xml"));
    myLoader.addEventListener (Event.COMPLETE, processXML);
    function processXML(e:Event):void {}
    myXML = new XML (e.target.data);

    var topic1:String = myXML.TOPIC [0]. FIELD_NAME;

    trace (topic1)

    };

    On the screen, I have a dynamic text field with an instance name of the Topic1. When I play the movie, the text does not appear. I tried various options of incorporation of text and using _without, but this does not seem to do the trick either. Help!

    You say you have a textfield with an instance name of the topic1, but in your code, you also declare a variable Topic1 you cast as a string.  The two cannot coexist.  If you really have a textfield named topic1then assign the xml value using textfield...

    Topic1. Text = myXML.TOPIC [0]. FIELD_NAME;

    But do not use a varioable with the same name as the TextField

  • How can I text in a dynamic text field to be a 'button '.

    Hi team,

    I have a project that has a bunch of variables I created for workd definitions.  I made a dynamic text box so that it loads just the exact text of the variable.

    NOW, the question is that I want to use a headset? (A href)? to find out if the user is clicking on a word inside the dynamic text box.

    There are some words in some definitions I have hepatitis also wrote definitions and separate variables for.  for example in the definition of promotion

    W5 Var = "Promotions".

    var def5 = "Promotions are where your company is looking to increase sales of a particular item by offering a good deal, advertising or a special screen. ';

    There is the word advertising, I would like to call a function that will be then set up the variable for pouring and thus alter the text in the dynamic text box

    I see a few examples online but I can't understand them and they use html or xml from a document external (I think?)

    Help, please!

    Here's the important bits of the code (please do not hurt you, laughing)

    W5 Var = "Promotions".

    var def5 = "Promotions are where your company is looking to increase sales of a particular item by offering a good deal, advertising or a special screen. ';

    function showdefinitions() {}

    worddefinitions. Play();

    wordDEF.text = years1;

    Def_word_1.text = ans2;

    wordDEF.visible = true;

    Def_word_1.Visible = true;

    Object (this.parent).defbackup.visible = false;

    }

    Object (this),.promotions_def.addEventListener (MouseEvent.CLICK, showpromotions);

    function showpromotions(event:MouseEvent):void {}

    years1 = def5;

    years2 = w5;

    showdefinitions();

    }

    Is this possible?

    See you soon

    void

    use:

    function parseTextF(keyword:String,txt:String,dataS:String):String {}

    I think you should consider 3 cases.  1. a keyword is to the beginning, 2. in the Middle, 3. at the end of txt

    for example: If 2

    var a: Array = txt.split (keyword);

    ' return an error [0] + "" + word + ""+ a [1];

    and you can have more than 1 keyword in txt

    }

    p.s. Please check the useful/correct, if there is.

  • dynamic text from the text vs PHP file

    OK, I'm at the last part of my project. He worked all the wells and the reading of the file as seen on all fields of text in a text:

    http://www.myblueranch.com/index2.html

    now, I'm trying to get the same thing from MYSQL.

    Notice that the text file that I used to index2.html is called

    www.myblueranch.com/trees1.txt

    and it's a copy/paste directly from the php page that gave the MYSQL query results. (the query php page is :)

    www.myblueranch.com/flash_names.php

    The problem is that I am getting an error in

    www.myblueranch.com/index.html

    that uses php to get the text for the dynamic fields.

    I get the following error:

    TypeError: Error #2007: text parameter must be non-null.

    to flash. text::TextField / set text()

    at final_fla::MainTimeline/onDataLoad()

    at flash.events::EventDispatcher/dispatchEventFunction()

    at flash.events::EventDispatcher/dispatchEvent()

    at flash.net::URLLoader/onComplete()

    my flash animation has 113 keys called button_1-> button_113 and 113 dynamic text-> tcname_113 fields tcname_1

    My AC3 code is as follows:

    Links button: all the buttons to open in iframe "tdes.

    link en button number

    I have 113 buttons.

    for (var i: int = 1; i < = 130; i ++) {}

    {if (this ["button_" + i])}

    This ["button_" + i] .addEventListener (MouseEvent.Click, f);

    }

    }

    function f(e:MouseEvent):void {}

    var n: String = e.currentTarget.name.split ("_") [1];

    navigateToURL (new URLRequest("ranch.php?id="+n), "tdes");

    }

    end of the links button

    Create the instance of URLLOader

    var myLoader:URLLoader = new URLLoader()

    the data will come as URL-encoded variables

    myLoader.dataFormat = pouvez

    Load using a URLRequest, same local beeing

    myLoader.load (new URLRequest ("flash_names.php"))

    listener onLoad handler

    myLoader.addEventListener (Event.COMPLETE, onDataLoad)

    Error handling

    myLoader.addEventListener (IOErrorEvent.IO_ERROR, onIOError)

    myLoader.addEventListener (SecurityErrorEvent.SECURITY_ERROR, onSecurityError)

    Could be an error or a message

    myLoader.addEventListener (HTTPStatusEvent.HTTP_STATUS, onHTTPStatus)

    Add a listener for the complete event

    function onDataLoad(evt:Event) {}

    trace (evt. Target.Data.cant);

    for (var i: uint = 1; i < evt.target.data.cant; i ++) {}

    This ["tcname_" + i] .text = evt.target.data ["tcname_" + i]

    This ["tcname_" + i] .autoSize = "left".

    This ["tcname_" + i] .multiline = true;

    This ["tcname_" + i] .wordWrap = true;

    this ["tcname_" + i] .width = 70; http://forums.adobe.com/post! input.jspa? = 2066 container & containerType = 14

    This ["tcname_" + i] .visible = false;

    This ["button_" + i] .addEventListener (MouseEvent.ROLL_OVER, buttonover);

    This ["button_" + i] .addEventListener (MouseEvent.ROLL_OUT, buttonout);

    trace (i);

    }

    }

    ON working CAPITAL make the visible text field and change color

    function buttonover(e:Event) {}

    var tf:TextField = TextField (this ["tcname_" + e.currentTarget.name.split ("_") [1]]);

    trace (tf.name);

    TF. Visible = true;

    tf.textColor = 0xff0000;

    }

    MAKE working capital change color and make invisible

    function buttonout(e:Event) {}

    var tf:TextField = TextField (this ["tcname_" + e.currentTarget.name.split ("_") [1]]);

    tf.textColor = 0 x 000000;

    TF. Visible = false;

    }

    reminders of the error

    function onIOError(evt:IOErrorEvent) {}

    trace ("IOError:" + evt.text)

    }

    function onHTTPStatus(evt:HTTPStatusEvent) {}

    trace ("HTTPStatus:" + evt.status)

    }

    function onSecurityError(evt:SecurityErrorEvent) {}

    trace ("SecurityError:" + evt.text)

    }

    OK by adding '&' in the beginning was not a good idea, it seems that the best way is really to change your PHP so that it includes no extra blank characters at the beginning, but if you want to manage this side Flash you can do the following:

    1. restore your PHP to how it was before the return data do not begin by '& '.

    2. Remove myLoader.dataFormat = pouvez; so that the loader loads the data as string

    3. in your onDataLoad function follow these steps:

    function onDataLoad(evt:Event):void {
         var data:String = e.target.data;
         data = data.replace(/\s/g, ""); // remove extra white spaces from the data received
         var vars:URLVariables = new URLVariables(data); // create URLVariables object from the data string
         trace(vars.tcname_1); // traces "CherokeeSweetGum"
         ...
    }
    

    --

    Kenneth Kawamoto

    http://www.materiaprima.co.UK/

  • Dynamic text from the text file problem

    Go step by step to get my data from MYSQL/php... for now, I'm stuck and cannt even get it from a text file I do worng!

    This is the code I use:

    var myLoader:URLLoader = new URLLoader()

    myLoader.dataFormat = pouvez

    myLoader.load (new URLRequest ("trees.txt"))

    myLoader.addEventListener (Event.COMPLETE, onDataLoad)

    function onDataLoad(evt:Event) {}

    for (var i: uint = 0; i < evt.target.data.cant; i ++) {}

    This ["tcname_" + i] .text = evt.target.data ["tcname_" + i]

    }

    }

    My trees.txt file contains the following:

    Plum = tcname_0 & tcname_1 = olive

    I made this as well:

    & tcname_0 = Asian plum & tcname_1 = Amazon lily &

    I have already created a few instances of dynamic text from tcname_0 up to tcname_5

    I tried with having the text in dynamic text or leave it empt anyway... nothing is read from the text file, what I am doing wrong?

    In your trees.text file, you neglected to include the variable of cant, so the loop has an undefined value to life...

    Plum = tcname_0 & tcname_1 = olive & cant = 2

Maybe you are looking for

  • photo memories

    I have 80 GB of pictures spanning 15 years, but when I run the function of memories it tells me that I have not the slightest recollection :-(

  • I get a popup Facebook!

    I keep getting a pop up on my Facebook screen, even when I am not connected to FB, asking me to: 'Enter the password [my e-mail address] in system preferences' it is a scam, how do I get rid of this annoying pop up!  Help.

  • How to solve problems with the download of updates?

    When I try to manually update the phone, I mentioned that there was an error when searching for updates.In addition, the update of the market without download, because thus there was an error.

  • X carbon 1 with 2200 error at startup

    I just replaced the motherboard in a carbon X 1 (3444) and I have downloaded and run the disk hardware (ASP here), but can't for the life of me understand how update the serial number and the machine for the new MOBO MTM. Can someone tell me please i

  • chnFind - to find the value of chnnel

    Hi all According to DIadem help, SMC determines first index specifies the channel line, the second index specifies the channel by the channel name or the number of the channel. for example: ChnFind ("Ch (2) > 300", 250) line worth > 300 250 searches