Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Data Integration / October 2007



Tip: Looking for answers? Try searching our database.

swf not connecting to another domain using sendAndLoad

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
waaby - 30 Oct 2007 06:08 GMT
Hi there,

Hoping someone from the good community can help me.  I work for this cool
mobile company that enables all sorts of SMS powered campaigns.  We have
developed a small flash widget that we host that users can point to from their
websites to sign up mobile subscriptions.  You can see an example here (the
white, Free text Updates widget): http://myspace.com/msgme_67463

I want to take this to the next level and allow our clients to host the swf,
and give them flexibility to design and integrate however they want.  In
testing, i am running into some connection problems.  The widget uses
sendAndLoad and posts the phone number to our service.  It connects and works
fine when i test movie, but the standalone swf or when hosted on another server
cannot connect.  Doesn't seem like a domain security issue as i have tried
System.security.allowDomain("*"); and System.security.allowInsecureDomain("*");
to no avail, but not sure what else it could be.  

Here is the code on the Submit button....any help would be appreciated....

function doSubmit() {
    userData = new LoadVars();
    userData.area_code = area_code;
    userData.prefix = prefix;
    userData.suffix = suffix;
    keyword_id = 15351;
    response = new LoadVars();
    var url_pre:String =
"http://www.msgme.com/Main.php?comp=SubscriptionWidgetBackendWeb&keyword_id=";
    var url_full:String = url_pre+keyword_id;
    userData.sendAndLoad(url_full, response, "POST");
    response.onLoad = function(success:Boolean) {
        // If Flash is able to successfully send and load the variables from the
server-side script...
        if (success) {
            // if the server returned the value of isValidLogin with a value of 1...
            if (this.status == '0') {
                gotoAndStop (2);
            } else if (this.status == '202') {
                ebox.gotoAndStop("show");
                ebox.status_lbl.text = "This number is invalid.  Please try again.";
               
            }else if (this.status == '1747') {
                ebox.gotoAndStop("show");
                ebox.status_lbl.text = "This number's already subscribed.";
           
            }else if (this.status == '1751') {
                ebox.gotoAndStop("show");
                ebox.status_lbl.text = "The max number of subscribers is reached.";
               
            }else if (this.status == '201') {
                ebox.gotoAndStop("show");
                ebox.status_lbl.text = "There is a system error.  Try again later.";
            }
            /* this code is only executed if for some reason the SWF is
              unable to connect to the remote page defined in LoadVars.sendAndLoad */
        } else {
            ebox.gotoAndStop("show");
            ebox.status_lbl.text = "There's a network error.  Try again later.";
        }
        }
    };
Tony - 31 Oct 2007 05:28 GMT
Wouldn't you have to have a crossdomain.xml file at the domain you were
retrieving data from?

> Hi there,
>
[quoted text clipped - 64 lines]
>  }
>  };
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.