Pass sendAndLoad var to _root

I have an app that has been getting the username of a user
into a simpleConnect for a chat application by passing it in via
the embed params, but this creates a security issue and would like
to pass it in using sendAndLoad.
Currently the username value is set simply by using: var
username=_root.username, because it's passed in via a php page with
that variable in the embed params. Like this:
<embed src="member.swf?username=<?php echo
$row_getMemberData['username']; ?>
The ID in this example is hardcoded but would be passed in
the same way that I'm currently passing in the username:
member_id = 10762;
mid = _root.member_id;
var send:LoadVars = new LoadVars;
var receive:LoadVars = new LoadVars;
send.mid = mid;
receive.onLoad = function(){
_root.username=this.username;
send.sendAndLoad("
http://urltomyphppage.php",receive,"POST");
trace(username);
stop();
That trace comes up undefined. I can trace it from within the
function, but I need to make it available to the main timeline so
the simpleConnect can pick it up....
As always any help at all would be greatly appreciated!!!
JAH

I am sorry, but I fail to see what it is that you are trying to do
<div id="list" spry:region="dsContratto">
          <!--- region ---> 
          <tr spry:repeat="pv" spry:even="even" spry:odd="odd"> 
              <a href="javascript:open({contratto_id},'sost')">OpenModal</a> 
          </tr> 
</div>
I can see that this opens a separate window, but how does the following relate to the above?
function open(id, action) { 
    open modal and linked-region
function funcObserverLinkedRegion(notificationState, notifier, data) { 
    how a can get value of "action" var?
Spry.Data.Region.addObserver("detail", funcObserverLinkedRegion); 
Gramps

Similar Messages

  • How can I pass a var value between MovieClips?

    New week, new question.
    I haven't been able to find the answer to this: I'm working with a var defined in the main timeline var score:int; , wich I use in 10 different movie clips using var score = MovieClip(this.root).score;
    Everything works perfect on the first MovieClip, but when the next one plays score does not keep the value assigned in the previous MovieClip therefore the score is lost.
    The clips are questions and they are place on the main time line in different frames and main time line actions layer which only contains this:
    stop();
    var score:int;
    nextQuestion.addEventListener(MouseEvent.CLICK, newQuestion);
    function newQuestion(evt:MouseEvent):void {
        nextFrame();
    covers each frame with every different MovieClip.
    What I need to know is how to make that value pass to the next Movie Clip?

    Hi Ned,
    I had defined the score var in the time line but to add the score from each question (MovieClips) I have to call it to the each MovieClip and I assume that whe I call the score var in the second MovieClip will keep the score from the first, but is not the case:
    This is the time line actions layer:
    stop();
    var score:int;
    nextQuestion.addEventListener(MouseEvent.CLICK, newQuestion);
    function newQuestion(evt:MouseEvent):void {
        nextFrame();
    and this is the code from the first question (MovieClip)(all the questions will have the same code except for some specific things like the value that each answer adds to the score and stuff like that)
    stop();
    var score = MovieClip(this.root).score;
    var answersArray:Array = new Array();
    var strikeCount:int;
    var sucessCount:int;
    var messageBox:TextField = new TextField();
    messageBox.text = "" + score;
    addChild(messageBox);
    messageBox.textColor = 0xFF0000;
    messageBox.width = 200;
    messageBox.height =100;
    messageBox.x = 285.5;
    messageBox.y = -32.9;
    this.strikeOne.visible = false;
    this.strikeTwo.visible = false;
    this.strikeThree.visible = false;
    this.flipQ1One.visible = false;
    this.flipQ1Two.visible = false;
    this.flipQ1Three.visible = false;
    this.flipQ1Four.visible = false;
    function answListener(evt_obj:Event){
    if((strikeCount >=3) || (sucessCount ==4)) { nextFrame();
    }else if (answersArray.indexOf(answ_input.text) < 0){
        if(answ_input.text == "5"){
        score = score + 61;
        messageBox.text = ""+ score;
        this.flipQ1One.visible = true, flipQ1One.play();
        sucessCount = sucessCount +1;
        answersArray.push(answ_input.text);
        answ_input.text = "";
        else if (answ_input.text == "3"){
        score = score + 25;
        messageBox.text = ""+ score;
        this.flipQ1Two.visible = true, flipQ1Two.play();
        sucessCount = sucessCount +1;
        answersArray.push(answ_input.text);
        answ_input.text = "";
        else if (answ_input.text == "4"){
        score = score + 8;
        messageBox.text = ""+ score;
        this.flipQ1Three.visible = true, flipQ1Three.play();
        sucessCount = sucessCount +1;
        answersArray.push(answ_input.text);
        answ_input.text = "";
        else if (answ_input.text == "2"){
        score = score + 3;
        messageBox.text = ""+ score;
        this.flipQ1Four.visible = true, flipQ1Four.play();
        sucessCount = sucessCount +1;
        answersArray.push(answ_input.text);
        answ_input.text = "";
        else {answ_input.text = "";
              strikeCount = strikeCount + 1;}
    answ_input.addEventListener("enter", answListener);
    function strikesListener (evt_obj:Event) {
            if ((strikeCount == 1) && (answ_input.text != "5", "4" , "3" , "2")) {this.strikeOne.visible = true;
            else if ((strikeCount == 2) && (answ_input.text != "5", "4" , "3" , "2")) {this.strikeTwo.visible = true;
            else if ((strikeCount == 3) && (answ_input.text != "5", "4" , "3" , "2")) {this.strikeThree.visible = true;
            else {}
    answ_input.addEventListener("enter", strikesListener)

  • Passing Form Vars to a CFC

    I am trying to pass Form variables to a CFC. Yes, the CFC
    works being called from Flex, with no arguments, but being new to
    Flex I am not sure how to post the values in the form fields back
    to the CFC. So my questions are:
    1) how do you reference form variables. They are all enclosed
    in a form tag, and then by form item tags, I have a variety of
    types of inputs
    2) How do you pass that information to the cfc? Currently I
    am using this code: getSearch.getSearch.send({values:vals});
    In an attempt to pass an array full of values to the CFC.
    Any help would be great!
    Thanks,
    Rob

    I know exactly where you are coming from...LOL..
    I was there too. Here is what you can do to make it easy on
    you.
    You wrap them in an object.... It is as simple as that.
    say that you have multiple form items.
    if you are using a data typed object ( I recommend it) you
    would do something like this to pass form data to a cfc
    // This creates a data typed object called object.
    var obj:AS01Phone = new AS01Phone;
    //Populate the data typed object with your form data
    obj.UserID = Number(userid);
    obj.PhoneType = String(_phoneType.selectedItem.KeyValue);
    obj.DialCode = Number(_dialCode.selectedItem.DialCode);
    // Now send it to the cfc for processing
    // [RemoteObject.method(object);]
    roPhone.save(obj);

  • Passing session var

    I'm trying to assign session. var to domain names. E.G
    (mydomainname.com) and (somthingdiff.com)
    so if user went to mydomainname.com then went to
    somthingdiff.com this would contain the same session.var.

    I don't think you can do that. You are ending a session on
    mydominname.com and starting a new one on somthingdiff.com. Pass
    your variable in the URL.

  • Passing JavaScript Var ---- to java method....URGENT...PLEASE ...HELP

    I am doing a simple java Servlet example...
    I have value that is assigned in a one of the javascript function().
    Below i have the function where i get the columnValue....
    i want to use that value in the doPost method in my Servlet1 class...
    Can someone please tell me how i can do this...
    function getGridValue(oColumn) {
         var oRow;
         var oCell;
         var lIdx;
         var columnValue;
         try {
              lArrayLength = GridArrays.length;
              if (lArrayLength < 1) {
                   return false;
              for (lLoop=0; lLoop<lArrayLength; lLoop++) {
                   oRow = GridArrays[lLoop];
                   oCell = oRow[0];
                   columnValue = oRow[oColumn];
                   if (oCell.SortVal == 1) {
                        alert(columnValue.SortVal);
                        break;
                        return true;     
         catch(exception){
              if(exception.description == null){
                   alert("GridSerVal: " + exception.message);
              else{
                   alert("GridSetVal: " + exception.description);
    Servlet1 class
    public void doPost(HttpServletRequest request, HttpServletResponse res)
    throws IOException, ServletException
    String xParameterName = null;
    String xParameterValue = null;
    PrintWriter out = res.getWriter();
    PolicyInformation policyInformation = null;
    Enumeration e = request.getParameterNames();
    while (e.hasMoreElements()) {
    xParameterName = (String) e.nextElement();
    xParameterValue = request.getParameter(xParameterName);
    if ((xParameterValue.trim().length() !=0 )){
    if(xParameterName.compareTo("firstnameTextfield")==0){
    else if(xParameterName.compareTo("lastnameTextfield")==0){
    else if(xParameterName.compareTo("policynumberTextfield")==0){
    StringBuffer outstring = new StringBuffer();
    outstring.append(createScript.policyReCreateSearchForm(xParameterValue));
    outstring.append(createScript.setTopPart());
    outstring.append(createScript.getHeader());
    Vector policyInformationVector1 = getPolicyInformation(res, xParameterValue);
    Iterator iter = policyInformationVector1.iterator();
    PolicyInformation aPolicyInformation = null;
    while(iter.hasNext()){
    Object[] data = new String[policyInformationVector1.size()];
    for (int ii=0; ii < data.length; ii++){
    int rowNum = ii + 1;
    aPolicyInformation = (PolicyInformation) iter.next();
    f = aPolicyInformation.getFirstName();
    l = aPolicyInformation.getLastName();
    d = aPolicyInformation.getDOB();
    s = aPolicyInformation.getSSN();
    p = aPolicyInformation.getPolicyNumber();
    m = aPolicyInformation.getMiddleName();
    pid = aPolicyInformation.getPid();
    outstring.append(createScript.setRowValue(f,m,l,p,pid,d,s,rowNum));
    outstring.append(createScript.setRowValue1());
    outstring.append(createScript.getBottom());
    out.println(outstring.toString());
    else if(xParameterName.compareTo("ssnTextfield")==0){
    THis is where i want to get the value from the javascript and use that value to run a query...
    // checks if the ViewSubmitButton is submitted....
    if(xParameterName.compareTo("viewSubmitButton") == 0){
    } // end of while(e.hasMoreElements())

    I'm not quite sure what your problem is specifically, but at first glance I can tell you that you can't access the response object until you are done with your request object. Make sure you do everything you want to do with the request object and then when you are done make your call to res.getWriter() and send your output.

  • What is the best way to pass a var from php to a swf to swf

    Hi,
    Whats the best most correct or professional (less chances of error or most efficient) way of sending a var from php to a swf container and then to a swf that is loaded with the loader class from the container???
    Thanks

    Hi Kglad thanks for the answer,
    Yes using AS3, I think I didnt give u enough info though.
    The thing is the php file is actually the index file which has the first swf lets call it conatiner.swf embeded and conatiner.swf then calls the other swf lets call it main.swf by using URLloader. So I dont think I can user URLloader on the index.php file, and I cant put the code in another .php file and call it because I need data from the index.php file specifically.
    Any ideas?
    I know I can use flash vars for the first step of the index.php to container.swf but im trying to avoid it cause im not so familiar with it or embedding and theres two diferent embedding methods im using depending on the site and im probably going to have to change them again later on cause im still having an issue.
    Thanks

  • Passing Flash Vars Through Query Strings and JS

    I'm trying to get a particular video to play in a flash ad
    when a particular query string is clicked. I can't get it to work
    and would appreciate any help that you can provide. The ad plays
    but the movies don't show when the query string is clicked or when
    you click on objects in the movie that are supposed to populate a
    movie. Here's the code I've been trying to use:

    Thanks for the advice, I have tried Javascript to resolve the
    problem. In response to the <object> tag missing, There is
    one I just included a snippet of the html code sorry for the
    confusion. Due to deadlines I abandoned the functionality of the
    script and "dumbed" down the script. Thank you again for the help

  • Passing structure vars

    I'm working on an authentication page and I'm setting user
    variables inside a structure. When I use a structure to set user
    variables and redirect to a landing page, the structure data does
    not persist. When I use sessions for each user variable, the
    structure persists. I'd prefer to use a structure, but what am I
    missing here? How do I get the structure to persist?

    Put the structure into the session so it persists
    <cfscript>
    session.piuser = structNew();
    session.piuser.authenticated = 1;
    session.piuser.username = auth_user.displayname;
    </cfscript>
    For any variable to exist from one request to another it must
    be in one
    of the persistent scopes. Whether the variable is simple or
    complex,
    you must place it into the session, application or server
    scope for it
    to be available on future requests.
    The one issue to this is that the cookie and client scopes do
    not allow
    complex variables without translation. But that is not often
    an issue.
    But when it arises, WDDX can be used to good effect.

  • Passing vars to a component in as3

    This doesnt seem particulary easy... or poetic for once of a better word.
    I was hoping I could write something like....
    BookingCreator = new CreateBooking(myvar);
    But what do I put In the mxml constructor for that component?
    Its a panel so where does myvar go?
    If I could hand it myvar like that I would then use creationComplete.
    But because I dont no how to pass a var direct to the constructor Im doing it this way instead...
    BookingCreator = new CreateBooking();
    BookingCreator.addEventListener(FlexEvent.CREATION_COMPLETE,onCreated);
    mod.root.addElement(BookingCreator);
    private function onCreated(e:FlexEvent):void{
    BookingCreator.model = mod;
    BookingCreator.init();
    Is that the only way to do it?

    You can't use parameters in the constructor.
    I don't have an issue with what you are doing but I do have an issue with the way that you are naming object instances as though they are classes.
    BookingCreator is an instance, not a class - it should be named 'bookingCreator'.
    NEVER name variables with a capital letter at the start.
    If you type 'MXML constructor' into Google you will get plenty of hits about this subject.

  • Passe var

    Hello,
    I'm just hacking on my keyboard but I cannnot find a solution
    for my problem.
    I wrote a dirty little function and trying to combine it with
    the blind effect. My function should be executed after the blind
    effect finished so I thought it would be the easiest way to use the
    finish parameter to call my own function after I had called the
    blind effect with onclick="blindUp.start()". Now the problem: I
    have to pass a var throught both function, the effect as well as my
    function, this var should contain the id of the div which I want to
    blind up but if I try to do it in this way
    onclick="blindUp.start('divId')" I get an error.
    Error: contentId is not defined
    Source: file://...../custom.html#content1
    Line: 94
    Line 94: var blindUp = new Spry.Effect.Blind(contentId,
    {duration: 600, from: '0px', to: '755px', toggle:false,
    finish:createObject});
    Thats a bit annoying because everythings works fine if I use
    no variable but I need it to use the functions for different
    elements on this page.
    Does anyone know how I can fix that?
    Source code:
    quote:
    <script type="text/javascript">
    function createObject(contentId, filename)
    var ele = document.getElementById(contentId);
    var children = ele.childNodes;
    for ( var i=children.length - 1; i >= 0; i-- )
    ele.removeChild( children
    var pdfOb = document.createElement("object");
    pdfOb.data = filename+".pdf";
    pdfOb.height = 750;
    pdfOb.width = 700;
    pdfOb.type = "application/pdf";
    pdfOb.id = contentId+"-pdfOb";
    ele.appendChild(pdfOb);
    </script>
    <body>
    <a href="#content1"
    onclick="blindUp.start('content1')">Title 1</a>
    Click it<br />
    <a href="#content1"
    onclick="removeOpened('content1')">Close</a>
    <p> Lorem Ipsum...
    </p>
    <div id="content1" class="objectDiv">
    </div>
    <script type="text/javascript">
    var blindUp = new Spry.Effect.Blind(contentId, {duration:
    600, from: '0px', to: '755px', toggle:false, finish:createObject});
    </script>
    </body>

    What are you trying to do? If you're just trying to scale a loaded image to a new size, you don't need so much code. And you want to use a Matrix object to scale when doing a draw.
    See if this helps. I've gotten rid of some extra code and comments, so I could more easily read it:
    function lisenFullcouv(e : Event){
        Bitmap(d.content).smoothing = true;
        var m:Matrix = new Matrix();
        m.scale(.8, .8);
        var passe:BitmapData = new BitmapData(320,480,true);
        passe.draw(d.content,m);
        var voir :Bitmap = new Bitmap(passe);    
        addChild(voir)

  • I can send vars to php but not load

    My AS2 script:
    var sen = new LoadVars();
    sen.nam = "mycont";
    sen.wor = "test";
    myvar = sen.wor;
    And I got a button with the script:
    on (release){
    _root.sen.sendAndLoad("this.php", _root.sen, "POST");
    And a textbox with the var "myvar".
    My PHP content is:
    <?php
    $myf = "that.html";
    $cont = $_POST['nam'];
    $write = fopen($myf,"w+");
    $wor = fread($write, filesize($myf));
    $vars = "wor=" . $wor ;
    echo $vars;
    fwrite($write, $cont);
    fclose($write);
    ?>
    When running it the send is succesfull because I can see that
    it edits my file.
    But nothing is get into my textbox.
    Whan is the problem? I try to fix it two hours already.
    Thank yo for your help...

    well, first myvar is going to have a value of "test", but
    that doesn't mean anything's been received from your php file
    because you're assigned rec to have a property of wor that has a
    value of "test".
    if you're not seeing that, you have a problem that has
    nothing to do with your php file: you don't have a visible
    textfield that has variable myvar.
    second, you don't want to assign any properties to rec. you
    want those properties to be assigned by your php file so you can
    retrieve feedback from your script, including assurance that it
    executed properly.
    further, you don't want to use the code i showed. i
    mistakenly thought you wanted to send wor and its value to your php
    script but there's no reason for that. so remove that
    sen.wor="test" line of code.
    finally, you probably don't have a way to check the trace()
    functions output so you can't see if everything is working. instead
    of using trace(src), use myvar=src and make sure myvar is an
    existing visiable textfield variable. (or, even better, use a
    textfield instance name and assign its text property.)

  • Passing a parameter between flash movies

    I have a flash movie for drop down menus that is called by all flash/movie banner sections of my site. The banner movies use FlashVars to set the heading and an image. The trouble is that the flash menus also were set to use a flashvar to dictate the context of the menus and leave one top level menu highlighted to show the content to the user.
    I have not been able to get both of them to use the Flashvars functionality. The html page calls the banner movie directly and it can therefore access the Flashvars. The menu swf however - which is not called from the html page but instead is called from within the banner movie - cannot access the flashvars variables. That leaves me with two choices:
    1. Either use a different method for passing the context variable to the menu movie.
    2. HTML code calls the banner movie. I can continue using flashvars and get the context variable by reading it from within the banner movie - and then somehow pass the value down to the menu movie if that is possible.
    Far greater AS coders than me frequent this site and I'm hoping one of you can suggest how to get this done...
    Thanks yet again,
    Sam

    right, in the banner swf you've got something like:
    // use this to set a default value just in case
    var contextValue= 0;
    // now set it to the flashVar
    contextValue= root.loaderInfo.parameters.contextFlashvar;
    then pass the var you create into the menuswf -- see the red bit below:
    // create loader and ask it to load something
    var myLoader:Loader = new Loader();
    myLoader.load(new URLRequest("swfFolder/mySwf.swf"));
    //add listeners to the loader
    myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleComplete);
    myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, handleProgress);
    myLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, handleError);
    function handleComplete(event:Event){
         // give the loaded swf a reference -- name of the loaded file means nothing to flash file
         var westview_menus = myLoader.content as MovieClip;
       // now use that reference to set vars
         westview_menus.context = contextValue;
         addChild(westview_menus);
    function handleProgress(event:ProgressEvent):void{
        //progress handler stuff
    function handleError(event:IOErrorEvent):void{
        // error handler

  • Passing a variable into a Function?

    I simplified my original code as much as possible to show
    what I need.
    From the code below, I need to trace (x) so that it doesn't
    show the top value of 5.
    Actually, I need to be able to recognise which of the
    attachedMovieClip s have been pressed so's to do a getURL based on
    it.
    Can anyone help? Thanks.
    myButt.onRollOver = function() {
    var a = 0;
    for (var x = 0; x<5; x++) {
    var myClip = _root.attachMovie("Clip", "Clip"+a, a++);
    myClip._x = myClip._width*x;
    myClip.onPress = function() {
    trace(x);
    }

    Omigosh!!!!
    Thank you!
    'been banging my head trying to figure an alternative but
    this is great!
    btw, I did a search on that 'onPressValue' in the SE as well
    as through the NGs and nothing turns up. Not even in Flash 8 Help.
    What was that? a hack?
    Anyhow, best regards and fantastic mind-bending
    drawings!

  • Accessing class var from main timeline

    Hi all! Well I've been working on this for a couple of days
    now and just can't seem to get it to work right...... I'm still
    getting my feet wet with as3 and like it more and more everytime I
    use it.... almost.
    Anyways, here's where I'm running into trouble.
    Here's a dumbed down version of my project with all the other
    usless drivel excluded. Basically what I'm trying to do is declare
    a var and give it a value in my class. Then I want to be able to
    display that value on the stage and use it in the main timeline.
    Seems simple enough....
    I need to be able to pass the var from the class to the main
    timeline for use.... Any help on this would be GREATLY appreciated.
    Thanks.

    kglad, worked like a charm in my short test file... however
    in my real world flash file the class takes a short time to
    actually compute the value of the variable. If I fire the trace
    from the main timeline it will display NaN b/c at the moment it
    fires the value of the var doesn't exist b/c it has yet to be
    calculated......
    I don't really know the best way to delay this... would the
    best way be to somehow add an event listener to listen to the var
    to see when it is assigned a value?.... I'm open to suggestions.
    btw, good catch on the assignment of a string value!!
    Thanks!

  • Passing arguments to a WorkFlow launched from a Link field in a form

    Hi. Anybody knows if it's possible to pass some argument to a WF launching it from a form?
    In the form from which I call the WF, I have a var that contains a list. This list has to be passed as an argument to the WF.
    The code:
    <Field>
      <Display class='Link'>
        <Property name='name' value='Launch WF'/>
        <Property name='URL' value='user/processLaunch.jsp?id=My WorkFlow'/>
      </Display>
    </Field>Can I add something to the URL propriety to pass the var?
    Thanks,
    O

    add variables, prefixing them with 'op_', like the following:
    <Property name='URL' value='user/processLaunch.jsp?id=My WorkFlow&op_myVar=myvalue'/>

Maybe you are looking for

  • How to create one more server node for SAP J2EE server?

    Hi, Can any one please suggest how to create one more server node for SAP J2EE server? I am using WAS700. Thanks and Regards, Smriti.

  • I seem to have a brick help!

    I have a P105 s6147 and it will not boot up.  Power cord and battery good, tried a new hard drive just in case and it will not boot up.  Power light lites up and thats it.  It started to not boot up a couple of weeks ago but would with a few tries. N

  • Screen is messed up..help please

    I have the new video ipod and the screen is all messed up. The top of the screen is completely black and at the bottom you can slightly see the blue lines from the menu. It still plays the music though. It almost looks as if the screen is cracked but

  • Why does most of CS6 shut down with an error message?

    I bought CS6 last week and loaded it on to my computer. When I went to use it yesterday the majority of the programs didnt work. Photoshop is opening but illustrator and indesign dont. When I open indesign it opens, gets to the bit where you choose t

  • ISight Not Working After Adobe Flash Player Update

    I went on Chatroulette and the website said I needed to update my flash player. So I did. However, after I did, iSight does not work now on the internet. When it's selected as the video source, it just shows a ManyCam logo, which ManyCam has been del