header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
rani
Points:0
Posts:0

2/9/2010 5:02:10 AM

Title: passing values


how to pass value from one window(parent) to another window(child) and vice versa.
HELP PLEASE



1
Brig
Points: 0
Posts:0
2/9/2010 5:37:15 AM



are you taking about passing data between different windows of AIR application or the windows inside an flex application?

2
rani
Points: 0
Posts:0
2/9/2010 7:46:49 AM



i need to know in adobe air application how to pass values between windows

3
Brig
Points: 0
Posts:0
2/9/2010 11:43:56 AM



Suppose your parent window in AIR is crating a window like this :

private var myWin:MyWindow;
			
private function openWin():void
	{
		myWin = new MyWindow();
		myWin.title = "New Window Adobe AIR!";
		myWin.maximizable=false;
		myWin.open();		
	}

Now you can use "myWin" refrence to call any function declared in the new window to pass on variables etc. for e.g your child window is already having a function called "recieveVariables" then you can use the myWin.recieveVariables(var1,var2,var3) to send variables and communicate.

4
rani
Points: 0
Posts:0
2/9/2010 9:05:43 PM



hi Brig
In ur example it is accessing child class attributes but what if i want to access parent attribute or parent in child window.

help please

5
Taylor
Points: 0
Posts:0
2/10/2010 12:18:16 AM



Hi that's quite simple, from any popup window use

Application.application to refer to your main application window.

you can access public functions and variables from main Adode AIR Window as :

Application.application.methodOnParent();


6
rani
Points: 0
Posts:0
2/10/2010 1:35:44 AM



hi Taylor
i am writing open() on button click event on popup window(TitleWindow),here i want to access main application(WindowedApplication) attribute or function but ur code is not working.

public function open():void
       {
   	if(txtpsw.text=="bmc" && cmbname.text=="bmc")
       	{
       		PopUpManager.removePopUp(this);
                //Application.application.mainapplicationfunction(); 

       		
       	}
       	else
       	{	mx.controls.Alert.show("Incorrect login","Wrong Login"); 
       		txtpsw.text="";
       		cmbname.text="";
       	}
       }


Help Please.thanks in advance

7
Ninja
Points: 0
Posts:0
2/10/2010 1:57:03 AM



you have called code after removing "this" popup which means remove me , it will stop execution of any code after this line for current component.

try putting application code before line

PopUpManager.removePopUp(this);

you can also verify from flex debugger whether the particular line was executed or not.

8
Taylor
Points: 0
Posts:0
2/10/2010 2:13:17 AM



have you included the class

import mx.core.Application;

I have checked the code by simply calling a parent function on button click and it works fine. Also make sure your function in main application is public.
It should appear in code hint when writing Application.application.

9
rani
Points: 0
Posts:0
2/10/2010 2:43:21 AM



hey it worked
thanks a ton


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 4+2 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions