Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Supporting Technologies > Server-Side Scripting

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-05-2005, 01:03 PM   #1
Archangel7
Registered User
 
Join Date: Aug 2005
Posts: 5
Default using Flash to read from Perl

I have been working with Flash for a short time and I can't make this work...
I have read about loadvars and seen examples (not perl ones)... I tried to make a little flash accessing a little script for testing...

flash part (on layer1: frame 1)
Code:
var xx = new LoadVars();
xx.load("http://bruno.pcsolution.com.br/cgi-bin/qc/oo.pl");
xx.onLoad = ft();

_root.createTextField("txt",1,10,10,300,50);
txt.text = xx.opa+" * "+xx.opa2+" : "+xx.toString(); 

function ft(success) {
	if (success) { trace("worked");	}
	else { trace("nope"); }
}
perl part (prints on browser &opa=xxx&opa2=abc )
Code:
#!/usr/bin/perl

$| = 1;
use CGI qw/:standard :html3/;
use strict;

#print header;
print "Content-type: text/plain\n\n";

print "&opa=xxx&opa2=abc";
die;
print header is on comment, tried using it too, unsuccessfully.
my textfield shows as undefined * undefined : onLoad=undefined
trace shows "nope"

any suggestions? ideas?

thanks in advance
- Bruno
Archangel7 is offline   Reply With Quote
Old 08-07-2005, 12:53 AM   #2
madgett
is my last name...
 
Join Date: May 2004
Posts: 1,051
Default

The text in the textfield will always show up undefined because that code is executing while the loadvars is still making the request. You can only access loadvars variables after it parses the request. So you must place code accessing those variables inside the loadvars onLoad function.

Not sure why it's not a successful request, if you are accessing a different domain then you need a crossdomain.xml policy file on the other domain.
__________________
Anything is possible with Flash, it's just a matter of inventing the possibilities
Certified Swfwizard
madgett is offline   Reply With Quote
Old 08-08-2005, 11:47 AM   #3
Archangel7
Registered User
 
Join Date: Aug 2005
Posts: 5
Default

Quote:
Originally Posted by madgett
The text in the textfield will always show up undefined because that code is executing while the loadvars is still making the request. You can only access loadvars variables after it parses the request. So you must place code accessing those variables inside the loadvars onLoad function.

Not sure why it's not a successful request, if you are accessing a different domain then you need a crossdomain.xml policy file on the other domain.
okay... I understood why its undefined
but I unsuccessfully changed the

txt.text = xx.opa+" * "+xx.opa2+" : "+xx.toString();

to the onLoad function... still not working, now the textfield shows nothing ...
the perl script looks all right... if I put the URL on thw browser it works...
Archangel7 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:11 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.