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.

Tags: Adobe Animate

Similar Questions

  • Someone has problems with the visible property of the fields of dynamic text in html5 canvas?

    Hi, I have problems with text fields dynamic that I placed the Framework 1. I wanted to have a visible property false until after the click of a button. So, I placed a line of code on the layer actions of frame 1 as:

    This.Sum.Visible = false; sum is the dynamic text field

    Even with 5 other text fields.

    Some of the fields appear when I test the movie and others not, but no suppose to appear. The console.log shows no error, and when I investigated console.log as: 'console.log (this.sum.visible)', I get 'false '.

    Any ideas?

    Thank you for your time.

    Yes, the link displays multiple textfields whose visible property works without problems in an animated project of html5.

  • Value of the TextInput component spent in the field of dynamic text - part 02

    So I completely did not solve my problem, here is what happens...

    Update the dynamic text box is always a character behind what is entered in the TextInput component.  For example, my name is Shawn, if I entered 'Shawn' in the text entry the dynamic text boxes will display 'Shaw '.  He will enter the "n" if I type another character, and then go back, delete the extra character.

    Any ideas or help would be greatly appreciated.

    Try to use the CHANGE event on the contrary...

    F_NAME.addEventListener (Event.change, copyText);

    L_Name.addEventListener (Event.change, copyText);

    etc...

    function copyText(e:Event):void

  • How do I get a field of dynamic text inside a movieclip

    It's the stuff probably easy for most of you guys tried to have this work for the last hour, and it does not work.

    Basically, I made my own button which is a movieclip. Inside the movieclip on the normal/roll off the coast of the State, I put an instance name Dynamics «textbtn» textfieldwith

    my button is supposed to expand on 2 images on my mainstage, thought is to say something different in each picture.

    Insofar as I have this inside the movieclip on frame 1:

    textbtn. Text = MovieClip (parent) .buttonText;

    I have my mainstage in frame1:

    back_btn.addEventListener (MouseEvent.MOUSE_OVER, buttonRollOver);

    back_btn.addEventListener (MouseEvent.MOUSE_OUT, buttonRollOut);

    back_btn.addEventListener (MouseEvent.CLICK, buttonClick);

    function buttonRollOut(event:MouseEvent):void {}

    back_btn.gotoAndStop ("OFF");

    }

    function buttonRollOver(event:MouseEvent):void {}

    back_btn.gotoAndStop ("Over");

    }

    function buttonClick(event:MouseEvent):void {}

    back_btn.gotoAndStop ("Click");

    gotoAndStop ("frontpage2");

    }

    buttonText = "this is frame1 '; var

    I have my mainstage in frame2:

    buttonText = "this is frame2."


    I think that you are unnecessarily complex things.

    A good practice is not not to litter the timeline inside movieclips with code. When you want to go find a code to fix something, you may need to browse movieclips several levels deep to get the code in a frame. Soon, it become unweildly.

    If you want to use the chronology, I record the event listeners and also to set the text for the button of the timeline root. I also don't use "image tags" because they are very archaic, although can be used.

    To make your buttons I make a movieclip (affecting flash.display.Sprite for optimization of the base class of the clamp) and includes 3 layers. bottom of layer 1, layer 2 roll, layer text 3. I don't see any State 'on' mentioned in your code, so I left out that. Roll or "selected" and "textfield" layers should have instance names so that you can access. For example I would appoint the State selected for selected_mc and TextField in text_txt graph.

    If your button has been appointed as you say back_btn then the code would look like this, remembering that the event passes a target property:

    back_btn.addEventListener(MouseEvent.MOUSE_OVER, buttonRollOver);back_btn.addEventListener(MouseEvent.MOUSE_OUT, buttonRollOut);back_btn.addEventListener(MouseEvent.CLICK, buttonClick);Sprite(back_btn.getChildByName('selected_mc')).visible = false; // make sure the initial selected state is invisible
    
     function buttonRollOut(event:MouseEvent):void{    Sprite(Sprite(event.currentTarget).getChildByName('selected_mc')).visible = false;     TextField(Sprite(event.currentTarget).getChildByName('text_txt')).text = 'roll off'; // change to the roll off text}
    
    function buttonRollOver(event:MouseEvent):void{    Sprite(Sprite(event.currentTarget).getChildByName('selected_mc')).visible = true;     TextField(Sprite(event.currentTarget).getChildByName('text_txt')).text = 'roll on'; // change to the roll on text}
    
    function buttonClick(event:MouseEvent):void{    Sprite(Sprite(event.currentTarget).getChildByName('selected_mc')).visible = true;     TextField(Sprite(event.currentTarget).getChildByName('text_txt')).text = 'selected text'; // change to the selected text   gotoAndStop("frontpage2");  }
    
    TextField(back_btn.getChildByName('text_txt')).text = 'start text'; // change to the starting text of the button
    

    The display list returns DisplayObjectContainer and DisplayObject must always conclude with the 'type' they want to access it properly. That's why I Sprite() and TextField() wrapped around specific things. This gives you access to their settings.

  • Create a script of the class dynamic text field

    Hi all

    I came across a few subjects that relate to t my question but after reading, try different approaches and internet research, I'm still confused. How to create Visual elements, for example a text field, dynamically from Actionscript in a class file?

    Basically, I created a class file that loads an external XML file and now I want to create fields of dynamic text for the items in the XML file. I did some debugging and I know that the XML is properly loaded. I can also get it to create dynamic text fields when I place the code inside the fla. The problem is when the code is in the class file. I read that you must pass the display for the class object, but I'm still not clear on how to do it.

    Any help would be greatly appreciated! Thank you in advance!

    My fla has the following code on the first frame:

    Import classes.estimatesheet;

    var sheet1:estimatesheet = new estimatesheet("xml/estimationSheetFields.xml");

    Here's my class file:

    {classes package

    flash.xml import. *;
    import flash.display. *;
    import flash.events. *;
    flash.net import. *;
    import flash.utils. *;
    import flash.text. *;

    public class estimatesheet extends Sprite {}

    public var textFields:Array = new Array();

    public void estimatesheet (file:String) {}

    xmlLoader (file);

    }

    public void xmlLoader (file:String) {}
    var loader: URLLoader = new URLLoader();
    loader.dataFormat = URLLoaderDataFormat.TEXT;
    loader.addEventListener (Event.COMPLETE, handleComplete);
    Loader.Load (new URLRequest (file));
    }

    public void handleComplete(event:Event) {}
    try {}
    var allXml = new XML (event.target.data);

    {for each var item: XML (in {allXml.elements ())}
    createSheet (element);
    }

    } catch {(e:TypeError)}
    trace ("cannot parse for XML");
    trace (e.message);
    }
    }

    public void createSheet(data:XML) {}

    var textFormat:TextFormat = new TextFormat ("Verdana", 11);

    {for each var item: XML (in {data.elements ())}

    var textField:TextField = new TextField();
    textField.setTextFormat (textFormat);
    textField.text = element.@label;
    textField.x = 150 * i;
    textField.y = 150 * I
    stage.addChild (textField);
    i ++ ;
    }

    }
    }

    Each feature display MovieClip, Sprite, TextField, etc. should be added to the display list/stack. The addChild in your class only adds TextFields to the estimatesheet class by using addChild (textField) and adds them to the scene of the film using stage.addChild (textField). Note that the latest works if estimatesheet is added to the movie because if estimatesheet is not added to the film the stage property is zero and you can't add items to something that is null, does not exist. AddChild (estimatesheet) prepares the ground for reference the main movie.

    As for making your class of the document class, you need to rearrange some things in your class and add a way to load the XML file. Things aren't sure how flexible can be.

    Sean

  • Why my dynamic text fields are not complete?

    For some reason are not filling most of my fields of dynamic text. The only new thing before it stopped working correctly, I added was a new button, but anyway... Whether or not I take the key, no text field is filling. It is on all the layers I have. If I change the font of text fields, they begin to fill in correctly... and when I do all the characters of the same type... they begin to fill not more!

    Embed your fonts

  • External Embedded Fonts, dynamic text fields, later?

    Hi all

    I'm stuck in Flash8 land. Especially because I use mProjector and MDM Zinc to extend flash projectors and neither support AS3 properly so far. That said...

    Flash8 SWF file is able to use the fonts included in the 'other' sovereign wealth funds? I know it's a permanent fix and an area well-known confusion and well, I'm confused. All attempts I've done so far for an affair have succeeded or failed in various ways, but never completely to operate.

    What I want to do, use fields of dynamic text filled with data from a database (or XML file) with CSS styling, use fonts embedded in a "master font SWF". (and I would cream ice with that too!)

    Import fonts in, say, "shared.fla. I put them all for export via the link (with shared.swf). I opened my other FLAs (say main.fla) and I drag the library shared.fla fonts in main.fla library. Looking at the link, I see that it it set correctly import for Runtime sharing (shared.swf). I can see the fonts available in the list of fonts main.fla and can select and use it very well. I have to define the dynamic text field to incorporate policies to actually see them (and also myTextField.setStyle("embedFonts",true)).

    Now, everything works well and fine, but the kicker is when I want CSS to my text style. If I specify a login of linkage of police embedded in CSS, the text disappears. that I load 'style.css' and I h1 {font family: someEmbeddedFont;}, the < h1 > text will now disappear.

    Clues in how can I specify a font for use in CSS which incorporated thus will work WITHOUT this needed to be incorporated into the library police (as in, not an asset related)? Because it works fine if I incorporate the police in every single SWF. But when I try to use it as a common good, it does not work.

    Any ideas on how a person can achieve this?

    This is so I can change my shared.swf and provide all new fonts with the same identifiers link and change the font in an entire project without re - export any other sovereign wealth funds.

    Thanks for any info!

    I was more or less asking if you could create 2 new documents and comes knocking in the fonts and settings as an example of file for each of us looking to share certain assets of fonts properly.

    I would be happy to host a ZIP containing the example on my server files and you can put a file .txt with credits for you and/or your business.

    Re-edit:

    I want to especially your solution because the solution of sharedfonts.com (which by the way, does not work) is actually exported as Flash 6, CC1. Also your method requires only 1 file instead of a charger and 1 active fonts (fonts 2 files of each). When I change the documents in Flash 8 AS2, I have nothing else to errors. I think that sharedfonts.com is based on the hack is available in previous versions of flash, and that's why when I reproduce it in functional flash8, it simply doesn't work simply.

    Re-re-edit:

    So much worse... found an example of work, and it is not easy to find (unless you know its name or w/e): Sharing fonts in Flash

    His method works for me on the web and offline. It ended up being that if ever I save my documents in Flash CS3 and export to Flash 8, it won't work. But if I save-as down to Flash8 and then publish under flash8 also, it works. Very weird, but works...

  • Dynamic text field color change

    Is it possible to change the color of a field of dynamic text through Actionscript? I use 2.0. I know how to change a button or mc color, but not a text field. The text field is currently defined as a string. Thank you.

    The color of the text string that is displayed can be changed, but not the color of the string. Strings are quite a few tables of characters... aka data. Display a channel on the scene, only to be placed in a TextField. The TextField is the place where the Visual attributes of a chain are managed (font, size, color, etc.).

    TextFields have many properties, which is the text. The text property is assigned the value of string which assimilate you to.

    TextField.text = String

  • Scaling of dynamic text fields

    I have some fields in dynamic text inside a clip which can be resized (zoom in). When the holder clip is climbed, however, return to the line of the text field changes.

    Is it possible to lock the skin so that it does not move?

    Got it - I just need to embed fonts.

  • Pass a variable to a text entry field in a URL (was: I feel like it should be simple but)

    I think it should be simple, but I'm having a hard time finding how to pass a variable to a text entry field in a URL. I have a text input field ("enter your postal code') and a button that says 'Go '. When the user enters their zip and hit 'Go', I need the postcode, they came to pass in a URL to a new Web site so that they can see the offers in their region. This is a Flash 300 x 250 banner. Can someone help me?

    I can download my FLA somewhere and link to it if needed!

    Click on the frame that contains your go button and your textfield and paste Panel actions:

    go.addEventListener (MouseEvent.CLICK, f);

    function f(e:MouseEvent):void {}

    navigateToURL (new URLRequest ("http://namebrandinsurance.com/auto/newResults.php?zip=" + zip.text + "& submit = submit"));

    }

  • Passing a Variable presentation for a 2nd guest in limiting choices

    I want the user to select only one doctor from a single dashboard command prompt, and then I want to pass this value of doctor (let's call it "PV_Doc") to 3 different datafields in the query:
    Primary care physician
    Surgeon
    Doctor's referral

    The query will return the patients for which the chosen doctor was listed as on or more of these 3 areas using a statement like gold in the filter... like:
    Primary care physician = @PV_Doc OR
    Surgeon = @PV_Doc OR
    Referring physician = @PV_Doc

    The problem I have is that the list of unique doctors is about 5 000 entries. What I want to do instead is to have the maximum number of users results in a table edge invited by entering a value like 'Smith' and then in the 2nd dash prompt only show 40 entries of the 5,000 that contain this text string, by usign the box "constrain".

    I can't do thpugh because in order to limit the 'Show' the 2nd prompt values requires that I do a SQL statement that says Doactor is like % @ % PV_Doc, but using a SQL statement, I can't assign the value they choose in a new variable of presentation.

    Any ideas? How to make it easy for the user to select a doctor and then passing a variable presentation so I can pass it to all fields of 3 doctor in the filter?

    Use the dashboard separated guests, not constrain option between fields in the same dashboard prompt.

    1. make the first dashboard invites with a field only and put it in the first section:
    column to change the formula: '1'
    control: edit box
    variable of the set of presentation: pv_name_like

    2. make second dash invites with a field only and put it in the section two:
    column to change the formula: YOUR_TABLE. DOCTOR_NAME_COLUMN
    control: in the drop-down list

    SQL results:
    SELECT YOUR_TABLE. DOCTOR_NAME_COLUMN
    "Your CATALOGUE presentation".
    WHERE
    YOUR_TABLE. DOCTOR_NAME_COLUMN '%' |' @{pv_name_like}' | ' %'
    AND RCOMPTE (YOUR_TABLE. DOCTOR_NAME_COLUMN)<>

    variable of the set of presentation: pv_doctor

    3. make sure guided navigation report for the dash prompt in section two (point 2) to show only in pv_name_like is not null, or length('@{pv_name_like}') > 0.

    4. make or update your target destination to trigger only when the second GO touch (when the variable pv_doctor of presentation is filled). Put it on Chapter 3. You can resolve report hide-with navigation guided in Chapter 3 report.

    5. as the reference see this:
    http://108obiee.blogspot.com/search/label/guided%20NAVIGATION

    Initially, you see only the first line (edit field, name) and when you click on GO the second prompt appears with the filtered values. After you click on the second GO report is displayed.

    Concerning
    Goran
    http://108obiee.blogspot.com

  • Pass the value of form field into the message of confirmation box

    Hello

    I created a confirmation box that fires when a user presses a button on the form.

    Under "URL redirection" button, I have the following:

    JavaScript:confirmDelete('Please_Confirm_Reduction_of_Call_Off_Pick_requirement.','REDUCE_CALL_OFF');

    This in turn calls a PLSQL process that perform a database update for a form called P4_PICK_LINE text field

    Is that I would have to include the P4_PICK_LINE in the confirmation message, i.e. "Please confirm reduction of call off sampling requirement pick123' where pick123 is the value of P4_PICK_LINE

    I know that I can pass in variables like session & APP_USER. etc in the message of confirmation, but not sure about text form element values.

    I use the apex 4.0.0.00.46 on windows version 7.

    Any help would be great


    Thank you
    Chris

    Edited by: Cashy on 05-Sep-2012 03:44
    javascript:confirmDelete('Please confirm reduction of call off pick requirement ' + $v('P4_PICK_LINE'),'REDUCE_CALL_OFF');
    

    A complete list of javascript API functions can be found here: http://docs.oracle.com/cd/E10513_01/doc/apirefs.310/e12855/javascript_api.htm

    You may not use session variables unless your variables are sent to the server. As long as you don't offer you will rely on javascript ;)

    Concerning

    Nico

  • How can I build and pass a variable to the function getField?

    I need to know how to build and pass a variable to the function getField():

    I have a form of several sections similar to a spreadsheet.  Each section contains 5 rows of 11 columns.  Currently I have calculations in the field I want to consolidate and move to the level of the document.  The field names in each column are identical except for a row identifier.  For example, in the 1st row: a_debtType1, a_debtTerm1, adebtRate1, etc.  I want to be able to pass to a function of level document line identifier and that connect a function "getField.  Here is an example:

    Document-level:

    function calculateLoan (lineNumber) {}

    var myDate = getField("a_debtType"+lineNumber).valueAsString;

    var myDate = getField("a_debtTerm"+lineNumber).valueAsString;

    .. few treatment

    return

    }

    Level of the form:

    change the information in the form is ready for line 1

    function calculateLoan("1");

    Thanks in advance for any help.

    It seems good except how you call the function of what you have. The calculation script should be something like:

    Custom calculate script

    calculateLoan("1");

    Note that you can also get the line number if it is contained in behalf of the field that calls the script if you don't disturb him passing as parameter, assuming you named the fields correctly.

    For example, to calculate the field is called "row_total.1", you can get the line number in the script like this:

    var no_lig = event.target.name.split(".") [1] ;

  • a problem in passing multiple values in the loop settings for

    Hi all

    I am facing a problem in passing multiple values in the loop settings for.


    EX:

    CREATE or REPLACE PROCEDURE (pr_id OUT NUMBER) HAVE


    tab type is table of NUMBER;

    TEMP_TAB TAB;

    BEGIN

    Select the COLLECT LOOSE pr temp_tab pr_id;

    I'm in 1.TEMP_TAB. loop of COUNTING

    PR_ID: = temp_tab (i);

    end loop;

    END TEST;

    OUTPUT:-

    pr_id = 234578


    in the example above, I'm only a value as an out parameter. but I send you PR_ID of the loop.
    why I don't get all the values that the parameters.please offer a solution for me.

    Thank you my friend.

    More clarification, let's look at your code...

    -- create a procedure and have a single numeric out variable
    CREATE OR REPLACE PROCEDURE TEST ( pr_id OUT NUMBER ) AS
      -- declare a type as an array of numbers
      type tab is table of NUMBER;
      -- declare a varianble of that array type
      TEMP_TAB TAB;
    BEGIN
      -- query all the values from the table into the array
      select pr_id BULK COLLECT INTO temp_tab from pr;
      -- loop through each value in the array
      for i in 1..TEMP_TAB.COUNT loop
        -- set the value of the single OUT parameter, OVERWRITING any previous value it has
        PR_ID := temp_tab(i);
        -- loop around to the next value
      end loop;
      -- end the procedure with the final value of PR_ID
    END TEST;
    
  • Pass a variable from a link to a form of mail

    Hello

    I have a site with several pages (plain html) for products, on each page, there will be a link "order".

    When you click on the link it should achieve a simple ASP email form so that the person can fill in their data (it is a very simple e-commerce if you want), but the form should also send the data / name (invisible) produced with it and display it on the contact form, ex 'you make an order for product [Product]. " ', please enter your details below.

    In short, how to pass a variable from the link on the page of the product to the contact page (and display) as well as on sending it delivers the fields of seizure of the user with the name of the hidden product.

    Thanks in advance,

    G.L.

    > I do not know how to read the query string, then

    > he spent the form

    To assign the query string value to a local variable

    DIM productID

    productID = Request.QueryString ("productID")

    To include in the form:

Maybe you are looking for