[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Flash variable to javascript URGENT!!!!!!

Posted on 2011-03-03
6
Medium Priority
?
195 Views
Last Modified: 2012-05-11
I'm using this to send my flash variables to javascript:

signup_btn.onRelease = function()
{
	my_vars = new LoadVars();
	my_vars.username = pogu_username_1.text;
	my_vars.pword = pogu_pword_1.text;
	my_vars.gname = pogu_gname_1.text;
	my_vars.lname = pogu_lname_1.text;
	my_vars.gender = pogu_gender_1.text;
	my_vars.contactno = pogu_contactno_1.text;
	my_vars.email = pogu_email_1.text;
	my_vars.dob = pogu_dob_1.text;
	my_vars.addres = pogu_address_1.text;
	my_vars.difficulties = pogu_message_1.text;
	
	
	getURL ("Javascript:submitregdata('my_vars')");
	
	//trace(my_vars);
};

Open in new window


However my javascript function is returning the variables as undefined. Any ideas?
0
Comment
Question by:brettacvh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 16

Accepted Solution

by:
sjklein42 earned 2000 total points
ID: 35033602
I use ExternalInterface rather than getURL.

http://www.actionscript.org/resources/articles/638/1/Basics-of-using-the-ExternalInterface/Page1.html

Looks like this to call myJavascriptFunction from FLASH:
:
flash.external.ExternalInterface.call("myJavascriptFunction", arg1, arg2);

Open in new window

0
 

Author Comment

by:brettacvh
ID: 35033639
Is that relevant for AS2?
0
 
LVL 16

Expert Comment

by:sjklein42
ID: 35033653
Absolutely.  I'm still stuck back in the dark ages with AS2 myself.  :)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 16

Assisted Solution

by:sjklein42
sjklein42 earned 2000 total points
ID: 35033654
You need to include this header line:

import flash.external.ExternalInterface

Open in new window

0
 

Author Comment

by:brettacvh
ID: 35033672
Actually what seems to be working now is with  the '+' concatenation:

signup_btn.onRelease = function()
{
	my_vars = new LoadVars();
	my_vars.username = pogu_username_1.text;
	my_vars.pword = pogu_pword_1.text;
	my_vars.gname = pogu_gname_1.text;
	my_vars.lname = pogu_lname_1.text;
	my_vars.gender = pogu_gender_1.text;
	my_vars.contactno = pogu_contactno_1.text;
	my_vars.email = pogu_email_1.text;
	my_vars.dob = pogu_dob_1.text;
	my_vars.addres = pogu_address_1.text;
	my_vars.difficutlies = pogu_difficulties_1.text;





	getURL("Javascript:submitregdata('" + my_vars.username + "','" + my_vars.pword + "','" + my_vars.gname + "','" + my_vars.lname + "','" + my_vars.gender + "','" + my_vars.contactno + "','" + my_vars.email + "','" + my_vars.dob + "','" + my_vars.addres + "','" + my_vars.difficutlies + "')");

//trace(my_vars.difficutlies);
};

Open in new window

0
 
LVL 16

Expert Comment

by:sjklein42
ID: 35033712
What does the code for the Javascript function look like?  (The function we are calling)

We need to make the arguments on the FLASH side match the Javascript.  We may need to adjust code on both the FLASH and the Javascript to make it work easily.  Are you able to change the Javascript, or is that code already done?

Please post (at least) the Javascript source code for the submitregdata function so I can see it.

Thank you.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses how to create an extensible mechanism for linked drop downs.
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question