Returning php vars to flash AS

Hi,
I am not able to get a variable value from PHP back into
flash after sendAndLoad. I can only get the actual value returned
by php. here is the detail.
Initially from flash
dataOut.sendAndLoad("phptest.php", dataIn, "POST");
and the return from phptest.php
dataIn.onLoad = function() {
msg.text = ' returned from php is '+this.value1 + this.value2
the code in phptest.php
<?php
$a = "&value1=foo&";
$b = "&value2=";
$c = "bar&";
echo $a.$b.$c;
?>
in response
the msg.text reads like this
returned from php is foo";
It only returns the actual value of value1 and not the passed
value of value2, but one doublequote.
and this is what is displayed in the browser from the
phptest.php .
&value1=foo&&value2=bar&
any sugggestions. ?
Thanks for any help

thanks kglad
but how do you pass a variable value. For example, if you
don't want to send 'bar 'directly as the value for value2, but want
to use the value of a variable say $c which will have a value of
'bar', how do you pass that back to flash. In my example it won't
pass the value of $c as 'bar', unless I actually assign 'bar' to
value2. I need to be able to pass the value of $c rather than send
the assigned value. I looked at the various examples including
those from login examples, but they didn't work. has the same
problem. somehow AS does not seem to accept the values passed via
variable. Any other way to do it?
thanks

Similar Messages

  • Php vars to flash

    I'm useing the following scripts to pass a variable from php
    to a flash combo box....problem is I get undefined in the combo box
    when i test my movie using cntrl + enter and if i try to view the
    swf on the webserver.
    Will somebody please tell me what i'm doing wrong?

    Just a couple of notes.
    1) don't use a '$' in front of the variables you are sending
    to Flash.
    "$comboData1" should be "comboData1"
    2) Not sure about using multipl "echo" statements. I never
    have but that doesn't mean you can't.
    3) Try something straightforward first, like:
    echo 'comboData1=this is data 1';
    If that works then move up to trying the variables.
    4) The last thing to note is that your PHP variables are
    surrounded by quotes.
    "$dataForCombobox_1" should be $dataForCombobox_1
    Hope these help.
    Tim

  • PHP returning "undefined" variable to flash

    Hello Everyone, I am working on a touch screen POS login interface that takes in a four digit user pin and searches a database. It uses Flash, PHP and MYSQL. I need PHP to return the user name and access level. The AS3 code below is what I have so far, but it doesn't work correctly.
    "IntLogin" is the 4 digit pin that is sent to PHP when the user touches login on the GUI.
    function onLoginClick(e:MouseEvent):void
              keyLogin.gotoAndStop("KeyDn");
              var loader:URLLoader = new URLLoader();
              var request:URLRequest = new URLRequest("Login.php");
              var variables:URLVariables = new URLVariables();
              loader.dataFormat = URLLoaderDataFormat.VARIABLES;
              request.method = URLRequestMethod.POST;
              variables.login = intLogin;
              request.data = variables;
              trace(request.data = variables);
              loader.addEventListener(Event.COMPLETE, onComplete);
              loader.load(request);
               function onComplete(event:Event):void{
                        var loader:URLLoader = URLLoader(event.target);
                        var variables:URLVariables = new URLVariables(loader.data);
                        txtUser.text = variables.username;
    Next is the PHP code which works great in the browser when I implictly give $select a value, returning "username=Walker&access=1"
    However, when I run the program from Flash it returns an undefined variable and the end of the PHP file.
    <?php # Login.php
    require_once ('mysqli_connect.php');
    //Connect to the db
    if (!empty($_POST['login'])){
              $select = $_POST['login'];
              $sql = "SELECT Last_Name AS name, Access_Level AS level FROM Users WHERE User_ID = '$select'";
              $q = mysqli_query($dbc, $sql);
              if($q){
                        $row = mysqli_fetch_array($q, MYSQLI_ASSOC);
                        $name = $row['name'];
                        $access = $row['level'];
                        echo "username=$name";
      echo "&access=access";
    ?>
    I have have tried debugging the both the PHP and the AS code, but I am stuck. When I trace in AS3 I get the following:
    1445
    login=1445
    undefined
    $access";
    ?>
    Please if you anyone can help with this it would be greatly appreciated. I am on a strict timeline and I don't know what to do here.
    Thanks:)
    Jusmark

    You have to send it as a flash var
    Take a look at the code on my php webpage:
    http://www.spectacularstuff.com/php-test/inprogress/scrfix/home.php
    That is how I sent it to flash. Now, we want to receive it in
    flash. You need the following actionscript in AS3.
    // Display FlashVar onto webpage to ensure we are
    // receiving it
    var tf:TextField = new TextField();
    tf.autoSize = TextFieldAutoSize.LEFT;
    tf.border = false;
    tf.x = 50;
    tf.y = 10;
    addChild(tf);
    // Detect the FlashVar from the webpage
    try {
    var keyStr:String;
    var valueStr:String;
    var paramObj:Object =
    LoaderInfo(this.root.loaderInfo).parameters;
    for (keyStr in paramObj) {
    valueStr = String(paramObj[keyStr]);
    if (keyStr.indexOf(".") != -1){
    keyStr = keyStr.substring(0, keyStr.indexOf(".")); //now
    it's "home"
    // tf.appendText(keyStr);
    } catch (error:Error) {
    // tf.appendText(error);

  • Php style switcher + flash + IE = broken?

    I am using the PHP style switcher by Chris Clark (
    http://www.alistapart.com/articles/phpswitch/)
    and using a small flash interface to switch styles. 4 to be
    exact.
    I had this working before so i know it is possible.
    The problem is that when a user clicks on 1 of the style
    selectors (a star shape) it does not change the style instantly
    like its supposed to, it simply goes to the index.php , only after
    pressing on a navigation link does the style change to whatever was
    picked in the first place.
    You might think its a php issue, but I have spoken with chris
    and his only guess as to what is happening is that IE is caching a
    over-aggressively.
    I believe it might be some settings in Flash or the flash
    version.
    This style switcher does work perfectly in Firefox btw, Both
    in flash and text links. text links also work in IE.
    Is there some issue known between using a flash and a php
    link in IE? Any help is appriciated...

    Addendum is to use sendAndLoad and have the switcher.php
    return test data to
    Flash, such as the URL vars values being sent, and display in
    a TextField
    or if in IDE in a trace window.
    Lon Hosford
    www.lonhosford.com
    Flash, Actionscript and Flash Media Server examples:
    http://flashexamples.hosfordusa.com
    May many happy bits flow your way!
    "Motion Maker" <[email protected]> wrote in
    message
    news:[email protected]...
    > The picture is that you use a Flash movie to communicate
    with a php script
    > named switcher.php. It needs to send URL vars to that
    page. The URL var or
    > the URL value is not getting to the switcher.php script.
    >
    > Are you using LoadVars Actionscript class and what does
    send or
    > sendAndLoad line look like? Be sure syntax is correct.
    >
    >
    > --
    > Lon Hosford
    > www.lonhosford.com
    > Flash, Actionscript and Flash Media Server examples:
    >
    http://flashexamples.hosfordusa.com
    > May many happy bits flow your way!
    > "Nice Tan" <[email protected]> wrote in
    message
    > news:[email protected]...
    >>I really dont think its a php header issue, mainly
    because text links in
    >>IE
    >> work. it is just the flash that is getting it wrong
    in IE.
    >>
    >> I have gotten the style to stick, but now the
    problem is that regardless
    >> of
    >> what page you are on, when a style is selected it
    reverts back to the
    >> index
    >> page.
    >>
    >> Like i have said before, the flash interface works
    in FF. And also text
    >> links
    >> work in both FF and IE. It is just something with a
    query string link
    >> that
    >> makes it go to the main domain for some reason.
    >>
    >> the links looks like this btw.
    >>
    >> [code]
    >>
    http://domain.com/switcher.php?set=main
    >>
    http://domain.com/switcher.php?set=alt1
    >>
    http://domain.com/switcher.php?set=alt2
    >>
    http://domain.com/switcher.php?set=alt3
    >> [/code]
    >>
    >> and when a link in the flash interface is clicked,
    it goes to:
    >> [url]http://domain.com[/url] instead of the current
    page the end user is
    >> at.
    >>
    >> I am using php include for my content aswell. So my
    pages loook like:
    >> [code]
    >>
    http://domain.com/index.php
    >>
    http://domain.com/index.php?id=main
    >>
    http://domain.com/index.php?id=nav2
    >>
    http://domain.com/index.php?id=nav3
    >> etc.
    >> [/code]
    >>
    >
    >
    >
    >
    >> It just seems like Flash in IE is forcing the links
    to go to the main
    >> domain
    >> for some reason.
    >>
    >
    >

  • How to read a .php file in flash

    Hi,
    Does anyone know if there's a possibility to read out a .php file in flash? (Like the iFrame in html) Some other webs showed me the 'loadvars' array..
    Thanx!

    So.. I do need to make a dynamic tekst block? And add to the first frame the action (as3?):
    var lo:URLLoader = new URLLoader();
    lo.load(new URLRequest("http://www.hcdbfeesten.nl/aenb/test.php"));
    lo.addEventListener(Event.COMPLETE, typeIt);
    function typeIt(e:Event){
        trace(lo.data);
    It does show me:
    http://www.hcdbfeesten.nl/aenb/test.swf
    Nothing... Instead of:
    http://www.hcdbfeesten.nl/aenb/test.php

  • Php form mailer/Flash help

    I have a php form that I am using with my Flash file. It
    works great so far, but I would like to get confirmation from the
    php in the Flash file, that the info has really been sent. I think
    it is already sent up in the php, but I don't know how to handle it
    in my Flash file. The php file is attached. Do I use the echo? How
    would I do that? What I want, is in my Flash file to say sending,
    until I get then feedback from the php, and then say, sent
    successfully.
    Thanks a lot for any help!

    It is all inside an ifStatment that is inside a function,
    which gets called by the button that send the form. Here is the
    full thing.
    function validateForm(tName:String, tEmail:String,
    tSubject:String, tMsg:String):Void {
    trace("validateForm was called");
    if (tName == "" || tName == undefined) {
    trace("tName if");
    this.showAlertMsg("Please enter your name");
    } else if (tEmail == "" || tEmail == undefined ||
    tEmail.indexOf("@") == -1 || tEmail.indexOf(".") == -1) {
    trace("Invalid email address: "+tEmail+" infexOf1:
    "+tEmail.indexOf("@")+" indexOf2: "+tEmail.indexOf("."));
    this.showAlertMsg("Invalid email address");
    } else if (tSubject == "" || tSubject == undefined) {
    trace("tSubject if");
    this.showAlertMsg("Please enter a subject");
    } else if (tMsg == "" || tMsg == undefined) {
    trace("tComments if");
    this.showAlertMsg("Please enter some comments");
    } else {
    trace("the else was called...");
    var send_lv = new LoadVars();
    //send_lv.onLoad = ShowStatus;
    //send_lv.EmailType = "Quote";
    send_lv.Name = tName;
    send_lv.FromEmail = tEmail;
    send_lv.Subject = tSubject;
    send_lv.Comments = tMsg;
    send_lv.status = "";
    send_lv.sendAndLoad("php/sendContact.php",result_lv,"Post");
    this.showAlertMsg("Sending...");
    var submitListener:Object = new Object();
    submitListener.click = function(evt:Object) {
    var result_lv:LoadVars = new LoadVars();
    result_lv.onLoad = function(success:Boolean) {
    if (success) {
    this.tf_showAlertMsg.text = "Thank you for sending us an
    email";
    } else {
    this.tf_showAlertMsg.text = "Email did not go through";
    function showAlertMsg(msg:String):Void {
    this.tf_showAlertMsg.text = "";
    this.tf_showAlertMsg.text = msg;
    this.send_btn.onRelease = function() {
    validateForm(tf_Name,tf_Email,tf_Subject,tf_Comments);
    I tried the new way Dave posted and it still does not get the
    echo from the form.
    Thanks so much to both of you for the help!

  • Loading php variables into flash 8

    i'm trying to load some vars into flash 8. i tried
    loadvariables, loadvariablesnum, loadvars, google. can't figure it
    out.
    2 years ago when using flash mx trying the same thing, the
    line:
    loadVariablesNum("file",0);
    was enough to do the trick.
    but in flash 8 can't get it to work ;(
    i have the simplest php file, something like this:
    <?
    $town = "where";
    $person = "who";
    $sex = "male";
    print "town=$town&person=$person&sex=$sex";
    ?>
    the use of variables is a must, so the solution
    print "town=where&person=who&sex=male"
    doesn't do me any good. actually this works.
    so what's the correct way of loading this into flash 8?
    thanks guyz.

    you can also use a FlashVars= parameter in your
    <object><embed> code, IF you are using your PHP code to
    also display your flash movie, and if you only need to pass these
    variables once when the movie loads. If this is what you need to
    do, use this....
    <object ...>
    ....// other params .....
    <param name="FlashVars" value="<?
    echo var1name;
    ?>=<?
    echo var1value;
    ?>&<?
    echo var2name;
    ?>=<?
    echo var2value;
    ?>" >
    Though you will have to do that in two places, once in the
    object code, and once in the embed code.
    The embed code would look more like
    <embed ...... FlashVars="<? //php similar to above
    ?>" ..... />
    I have used this successfully to pass in variables when the
    flash movie first loads, to pass in stuff like a URL for a link and
    other info. There are a lot of different ways to pass values in to
    flash. You can also use ExternalInterface.call and use Javascript
    along with PHP to retrieve info at any time, but that is more
    complex.
    This may not be what you need - but you can still use
    LoadVariables with Flash 8, as well.

  • Sending php variables to Flash Builder

    Hi guys,
    I have made a form which when sent to a Mysql server adds a table to a database.
    Here is the code that I use in Flash Builder:
    <mx:HTTPService id="srv" url="http://mysite.com/addTeam.php" method="POST">
    <mx:request>
    <teamName>{teamName.text}</teamName>
    <city>{city.text}</city>
    </mx:request>
    </mx:HTTPService>
    ...<mx:Form x="25" y="10">
    <mx:FormHeading label="Add a team"/>
    <mx:FormItem label="Team name">
    <s:TextInput id="teamName"/>
    </mx:FormItem>
    <mx:FormItem label="City">
    <s:TextInput id="city"/>
    </mx:FormItem>
    <mx:FormItem>
    <s:Button label="Add" click="srv.send()"/>
    </mx:FormItem>
    And here is my addTeam.php file:
    <?php
      $teamName = $_POST['teamName'];
      $city = $_POST['city'];
      $addteam = $teamName ." ". $city;
      $connection = mysqli_connect("host", "username", "password", "db") or die(mysqli_connect_error());
      mysqli_query($connection, "SET CHARACTER SET utf8");  //the added table will be in bulgarian language
      $sql = "CREATE TABLE `$addteam`
      FirstName varchar(20),
      SurName varchar(20),
      LastName varchar(20),
      position varchar(20),
      price int
      mysqli_query($connection, $sql) or die ("Query failed: " . mysqli_error($connection));
    ?>
    My question is: How can I return some text to Flash Builder if the query was successful or failed (like "echo") so that the user (admin in this case) knows what is going on and not just clicking the add button and having to go to phpmyadmin to see if the table has been created or not?

    You have this declared
    <mx:HTTPService 
    id="srv" url="http://mysite.com/addTeam.php" method="POST">
    just add
    result="yourResultHandler()"/>
    then create the function that would handle the result.
    <mx:HTTPService 
    id="srv" url="http://mysite.com/addTeam.php" method="POST" result="yourResultHandler(event)">

  • Using 'Function Returning SQL Query' with Flash charts

    I have created a pl/sql function that returns a SQL query as a varchar2 of this form:
    select null link
    <x value> value
    <Series1 y value> Series 1 Label
    <Series2 y value> Series 2 Label
    <Series3 y value> Series 3 Label
    from tablea a
    join tableb b
    on a.col = b.col
    order by <x value>
    If I now call the function from a Flash Chart Series SQL box with the Query Source Type set to 'Function Returning SQL Query' like this:
    return functionname(to_date('30-sep-2010', 'dd-mon-yyyy'))
    it parses correctly and the page is saved; however, when I run the page I don't get any output - nor any error messages or other indication of a problem.
    Now, if I call the function in a SQL client, capture the SQL query output using dbms_output and paste that into the Flash Chart Series SQL box - changing the Query Source Type to SQL Query - and save the page it works fine when I run it and returns a multi-series flash chart.
    Can anyone suggest either;
    1. What have I might have missed or done wrong?
    2. Any way to usefully diagnose the problem...
    I have tried using the Apex debugger - which is very nice, by the way - but it doesn't provide any info on what my problem might be. I even tried writing my own debug messages from my function using the apex_debug_message package - got nothing...
    Thanks,
    Eric

    Hi Eric,
    Try expressing the source as this:
    begin
       return functionname(to_date('30-sep-2010', 'dd-mon-yyyy'));
    end;That works fine for me, and if I take out the begin-end and the trailing semicolon from the return statement I get the same behavior as you.
    It does mention in the help for the source (only during the wizard though) that this source type has to be expressed that way, but I agree it would be helpful if the tool would validate for this format when 'Function Returning SQL Query' is used or give some sort of indication of the trouble. Anyway, this should get you going again.
    Hope this helps,
    John
    If you find this information useful, please remember to mark the post "helpful" or "correct" so that others may benefit as well.

  • Loading HTML or PHP page in flash

    Hi,
    I would like someone to tell me if there is a way to load html or php page in flash just like a movieclip without actually navigating from the flash player(by using getURL code). Basically, I am wondering if there is a way to load a html file just like we load movieclips and perform all the functions of html page.
    Thanks,
    Abinash

    No.  Flash can only display html content in textfields and only supports a very limited number of html tags (look up the htmlText property of TextFields).  So to display an html/php file is not possible.

  • How we can load external html or php file in flash?

    Hi there,
    I want to show my php's file desing in flash..
    i m getting data through database in php file and it has
    table... so I want to show that data in my flash movie...
    Please help me ..
    How can I load external html or php file in flash?
    If any other way is there then plz tell me.....
    thanx

    No.  Flash can only display html content in textfields and only supports a very limited number of html tags (look up the htmlText property of TextFields).  So to display an html/php file is not possible.

  • Bringing php data into flash file

    I've got a php file, below is the code from it:
    <?php
    $dir = "photos/";
    // Open a known directory, and proceed to read its contents
    if (is_dir($dir)) {
    if ($dh = opendir($dir)) {
    $fileList = "";
    while (($file = readdir($dh)) !== false) {
    if ($file != "." && $file != "..") {
    If ($fileList == "") {
    $fileList = $file;
    else
    $fileList = $fileList . ", " . $file;
    echo "&newVar=$fileList";
    closedir($dh);
    ?>
    it returns a full list of files in a specified directory on
    the server.
    I need to pass that data into flash, so that it can build an
    array, and do
    other things with it.
    i can use:
    loadVariables("filename.php", "");
    and then create a text box with the variable value of
    "newVar" and it will
    display the file list, but I can't seem to get that string
    into a workable
    variable that i can do things to it.
    could someone point me to how to do this, or let me know if
    you need more
    info on it.
    thanks.

    I'm able to get the list into flash as it's currently
    written, but I can
    only get it to display in a text box instead of haveing it in
    a format that
    i can do things go.
    fileListArray = fileList.split(",");
    I've been using this code to split the php's return into an
    array of the
    file names. I just can't seem to get it to work with the
    loadvars/loadvariables stuff.
    for example, the below code works perfectly:
    var fileList:String;
    var fileListArray:Array;
    fileList = "01.jpg,02.jpg,03.jpg,04.jpg,05.jpg,06.jpg";
    fileListArray = fileList.split(",");
    when i try to display fileListArray[2] as the above code is
    written, it
    displays the correct .jpg file name. i just can't seem to
    find a way to get
    the php's return to work the same way.
    "DMennenoh **AdobeCommunityExpert**"
    <[email protected]> wrote in
    message news:f0amga$ldh$[email protected]..
    > You're close, but you don't want to return all the files
    in one variable -
    > return them all as something like file1 - filen. Then
    you can iterate file
    > in your onLoad.
    >
    > Change your PHP like so:
    >
    > <?PHP
    > $dir="photos/";
    >
    > // Open a known directory, and proceed to read its
    contents
    > if (is_dir($dir)) {
    > if ($dh = opendir($dir)) {
    > $ind = 1;
    > $fileList = "";
    > while (($file = readdir($dh)) !== false) {
    > if ($file != "." && $file != "..") {
    > $fileList .= "&file$ind=".$file;
    > $ind++;
    > }
    > }
    > echo($fileList);
    > closedir($dh);
    > }
    > }
    > ?>
    >
    >
    > Now, in your onLoad function you can do like so:
    >
    > myLoader.onLoad = function(success){
    > var ind = 1;
    > while(this['file' + ind]){
    > trace(this['file' + ind]);
    > ind++;
    > }
    > }
    >
    > Of course, you can then stick the files into an array...
    >
    >
    > HTH
    >
    > --
    > Dave -
    > Head Developer
    >
    http://www.blurredistinction.com
    > Adobe Community Expert
    >
    http://www.adobe.com/communities/experts/
    >

  • How to use a div id as a php var

    Hello,
      I have a form that is generated from a database with unique links that users can click and edit details about various vehicles.
    Now these links are each in their own div that has an id that i would like to use for insertion back into the database. (the users click the vehicles, then edit details, then it is submitted)
    The link is clicked for the vehicle, some details are changed via js windows etc, then the user click a finalize upload button to submit form
    For some reason i cant figure out how to use the div id to pass via php back to the database.
    what is the correct way to do this? not very experienced with ajax, and dont want to use.... but maybe hidden fields? confused.... the clicking of the unique divs does not submit the form, so not sure how to store the data effectively.... page cant be refreshed.
    [CODE]
    <div id="vehicle57">
    <a href="javascript:showSlider(57, 2001, 'Audi', 'A6' , 57, false);">
    <span class="videoStatHeading">VEHICLE: </span>
    2001 Audi A6</a>
    </div>
    <div id="vehicle54">
    <a href="javascript:showSlider(54, 1999, 'Dodge', 'Caravan' , 3, false);"><span class="videoStatHeading">VEHICLE: </span>
    1999 Dodge Caravan</a>
    </div>
    [/CODE]
    thanks a lot

    hello Shocker,
    here is the showSlider function, sorry didnt include it earlier
    function showSlider(vID,year,make,model,setupId,clickPOS){
              //remove default style
              //$("#uploadOptions").removeAttr("style");
              //window.alert("ID: " + vID);
              addMask();
        var pos;
        if(!clickPOS){
                  //make sure radio button 1 is showing
                  $("#firstRadio").show();
                  pos = calcPos(vID);//pos contains the position of the link clicks.
        }else{
                  //this means were clicked (change vehicle setup), hide
                  $("#firstRadio").hide();
                  pos = $("#bottomFieldset").offset();
                  pos.top           = pos.top-40;
                  pos.left           = pos.left-40;
        //reset error container
        $("#errorContainer").html("");
              //set width and height to zero before animation
              $("#uploadOptions").attr("style","height:0;width:0;opacity:0;filter:alpha(opacity=0)");
              //set position attributes rel to document
              $("#uploadOptions").offset(pos);
              /** AJAX request */
              if(!clickPOS){ //only reset
                        $.get("../ajaxResponders/getSetups.php",
                                  {vId: vID},
                                  function(data){
                                            $("#setup_span").html(data);//to strip the html headers from data
                        /** end AJAX request */
                        /** AJAX request */
                        $.get("../ajaxResponders/getSetupPic.php",
                                  {vId: vID},
                                  function(data){
                                            $("#setupThumb").html(data);//to strip the html headers from data
                         //reset error container
        $("#setupThumb").html(" ");
                        /** end AJAX request */
              //set element values of box
              $("#setupTextBoxWrapper").hide();//hide textbox
              $("#setupTextBox").html("").val("");//reset the textbox
              //set actionButton button text/script
              $("#actionButton").html("Confirm");
              $("#actionButton").attr("href","javascript:confirm();")
              $("#setupRadioOptions").attr("style",'');
              //$("#setupType").attr("checked",'false');//uncheck prev selected
              $("input[name='setupType']:checked").attr("checked",false);
              $("#vYear").html(year);
              $("#vModel").html(model);
              $("#vMake").html(make);
              $("#vID").attr('value',vID);
              $("#setupId").attr('value',setupId);//add setupId for case 1 & 2
              //animate box to open
              //$("#uploadOptions").hide().slideDown("slow");
              $("#setup_span").hide();
              //calculate height of setupbox
              var outerHeight = $("#setup_span").outerHeight(true);
              var fH = 280 +outerHeight;
              $("#uploadOptions").hide().css("z-index",9999);
              $("#uploadOptions").hide().animate({
                        "width": "500px",
                        "height": fH,
                        "opacity" : "1"
              },600,"swing",function(){
                        //adjust height to fit
                        $("#uploadOptions").css("height","");
                        //if no setups found in the db
                        if(!clickPOS){
                                  $("#setupLabel").html("Is this the setup for the media displayed?");
                                  var setSpanHTML = $("#setup_span").html();
                                  if($.trim(setSpanHTML)== "" && !clickPOS){
                                            //hide setup
                                            $("input[name='setupType']:checked").attr("checked",false);//uncheck selected box
                                            $("#setupType1").attr("disabled","disabled");
                                            $("#setupType3").attr("disabled","disabled");
                                            $("#setupType2").attr("checked",true);
                                            //no setup from db
                                            $("#setup_span").html('<span style="color:red">No setups found for this vehicle</span>');
                                            //flash setup span
                                            $("#setup_span").show().animate({
                                            "opacity":"0"
                                            },300,"swing",function(){
                                                                $("#setup_span").animate({
                                                                          "opacity":"1"
                                                                },300);
                                                      });//end function
                                            //flash confirm button
                                  }else{
                                            $("#setup_span").hide().slideDown("slow");
                        }else{
                                  $("#setupLabel").html("Change Setup");
              });//end function
    }//end function

  • Accessing Class Member Vars From Flash?

    Hi,
    I'm writing an audio intensive application that requires a lot of data manipulation on the Alchemy side and I ran into a wall with my approach.
    I'm using C++ to initialize a Class and populate its members in the "Alchemy-side" of the project. However, to keep things tidy and fast, I wish to write some audio data to a Float Array member of the class directly from Flash to avoid redundant copying.
    If this seems strange, I have done it successfully for a Float Array defined in the main C (or C++) file and passed a pointer back to AS3 so that the "shared memory" could find the precise location in memory and read/write:
    Setting up shared memory:
                   var ns:Namespace = new Namespace("cmodule.cppPackage");     
                   cRAM = (ns::gstate).ds;     
                   libLoader = new CLibInit();
                   lib = libLoader.init();     
    where cRAM is a byteArray I used and is associated with the shared memory. cRam,position = DataPtr would get me access to the data I want
    However, this approach hasn't proven fruitful for Data Arrays located within a class. Here is a quick look at my class implementation:
    class AudioChannel {
    private:
         int fs, frameSize;
         bool fftComputed;
    public:
         float *audioFrame, *fftFrame;
         int *intArr;
         int stuff;
         AudioChannel();                                             //default constructor
         ~AudioChannel();
         void initChannel(int fSize, int sampleRate);     //initializes the paramters
         int getSampleRate();
         int getFrameSize();
    the audioFrame array is allocated and initialized in the "intiChannel" method, and it has public access. From the main .cpp file I simply return &(ch.audioFrame), (ch is the object instance) as an AS3_Ptr so I can use that to find the data.
    The way in which I attempt to access the values in AS3 is as follows:
                   cRAM.position = chAudPtr;
                   for(var i:int = 0; i < 25; i++ ) {
                        cRAM.position = chAudPtr + sizeofFloat*i;
                        var tempVal:int = cRAM.readFloat();
                        trace('the tempVal is : ' + tempVal);
    The problem is, that the function returns the wrong values. chAudPtr is the address for the "audioFrame" member in the C++ class I defined earlier and the initChannelMethod initialized the first 25 values to 0 through 24. I confirmed this with trace statements in the C code. Furthermore, when I try to write to this memory, I receive:
    RangeError: Error #1506: The specified range is invalid
    Is this some sort of limitation of Alchemy with data structures (classes, structs, etc)?. The strange thing is I can read and write the primitive members of the class with no issues (i.e. "stuff, fs, frameSize") using the above methods. But I can't seem to get it to work right with arrays in the object.
    Any tips are appreciated, I'm trying to create something really clean and self-contained.
    Thanks.

    sorry about the &nbsp. you can ignore that...some weird formatting thing for the code-style formatting....

  • PHP Connection in Flash Builder 4

    Hi
    Sorry if this is in the wrong place. I could see nowhere else to ask this question.
    I am very, very new to Flash Builder (in fact, I am following a tutorial on building a data-centric application using Flash catalyst CS5 and Flash Builder 4).
    The problem I am having is that I cannot seem to validate the data connection in Flash Builder 4.
    For my project, I click "Connect to Data/Service" then select PHP. I select Flex Server and change the "Application Server Type" to PHP.
    The page I then get asks for a Web Root and Root URL. This is where I'm having problems. No matter what I type in these boxes, when clicking the "Validate Configuration", I get the error of "Cannot access the web server".
    I have Apache and PHP installed on this Windows 7 64-bit machine.
    The Web root folder for my site is actaully held on my D drive, so web root reads.. "D:\Web Files\Site".
    The URL for this local site is http://site.local
    I can browse to http://site.local in my browser and all is well. My site shows. I can even see this fine in Flash Builder's Internal web browser.
    I have tried moving the web root folder inside the default apache root htdocs folder, but get the same problem. I have even changed the permissions on all folders to allow full control, but this doesn't help.
    I really am starting to tear my hair out now. Can someone please help me? Am I doing something obviously wrong?
    Many Thanks

    Did you install apache / php / (optionally mysql) separately or in a bundle. I would suggest using xampp bundle, because it configures everything correctly along with installing a few helpful tools like phpmyadmin, etc. Great fast setup for testing purposes. Anyway... about the URL: I think the url you should be using is something like http://localhost/yourprojectfolder/...
    Presuming you have set up a project... and selected the option PHP at application server type you would then input (in my case, using the default xampp setup):
    Web root: C:\xampp\htdocs
    Root url: http://localhost
    Output folder: C:\xampp\htdocs\<projectname_here>-debug
    The url you d input in the browser to navigate to your project would then be: http://localhost/<projectname_here>-debug
    (no index.html at the end, provided your server is setup to serve this file automatically if it exists)
    Hope this helps!

Maybe you are looking for

  • I Tunes for WIndows wont start after upgrade to 8.0.1

    I recently upgraded to iTunes 8.0.1.11. After upgrade, if for some reason I need to reboot my computer iTunes will not start. It took forever to finally figure out what it was. I couldn't sync my iPod, could not get on to iTunes , etc. I finally had

  • Accounting doc not generated at the time of billing

    Hi Scenario is that we are going to import some products from thailand for onward local sales. New product is opened with price control v and price determination 2-(transaction based). With this setting, and without running cost estimae, we have comp

  • More than one class in a single file

    Hi, I am having two classes in one file. One is public and another one is internal. I am calling the internal class methods in some other files. If I compile the files(where I am calling the internal class methods) alone , I am getting compilation er

  • Best Practices for management VLAN

    Hi guys, I have a client with a data center where they have lots of VLANs running off a 3750 (main switch) and then they have a 3550 and a 2950 running off from this main 3750. They have lots of VLANs configured and I see that Vlan1 is not being used

  • Convert Windows ipod to mac; Can I go back?

    I read the following on Apple's knowledge info. "You can convert an iPod formatted for Windows into an iPod for Mac by using the iPod for Mac Software Updater on the Apple website. Note that once it is reformatted, it will only work with Macs. You ne