Welcome, Guest. Please login or register.
Did you miss your activation email?
02/08/12, 07:54
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  General
| |-+  Flex, Air, FlashBuilder, Catalyst (Moderators: ..:: Mazhar Hasan ::.., kofi addaquay)
| | |-+  How to initialize the variable in flex with the variable from flash AS3?..
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: How to initialize the variable in flex with the variable from flash AS3?..  (Read 1474 times)
hinomotoblade
Seasoned Programmer
***
Posts: 131


Flash Never Die :D


View Profile
« on: 03/14/10, 03:13 »

Hello i have the problem here,

For exmaple i have some mxml Application, and i have the variable name "A",
then i try to load my flash that containt variable inside the flash thats call the name "B"
with the SWFLoader..

nah can i initialize the "A" with "B"?..

I mean in my AS3 Flash i have B=10;

Then i have the variable in my mxml App is A=0;

How to make the A=B?..

Thank you very much.. I am really confuse aboout this because i am still like combine mxml with flash,
because flash is more interactive about the animation and another..

Thank you Smiley

Logged

Huihihi~ Cheesy
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6162


View Profile WWW Email
« Reply #1 on: 03/14/10, 09:36 »

you have to fetch some events.

Before you can access a value of an object, you have to wait for the object to be completed.
If the object is completed, it can fire a user defined event, or call a function to initialize.

In flash you can do the initialize into the first frame - just make sure, it will not be touched after it initialized first Wink

With flex components you can define a creationComplete_handler, which will be executed, when the component is ready to use.
Logged

happy flashing
Cool
Ronald
hinomotoblade
Seasoned Programmer
***
Posts: 131


Flash Never Die :D


View Profile
« Reply #2 on: 03/14/10, 10:28 »

Ummm, can you give me some example?..

Sry i am confused.. :p

I mean how to make the function / method to initialize the variable in my SWF Loader (External As3) to the variable in my mxml application,

For example like this,

In mxml i have some textArea id="B"..
Then in flash i have the variable A="Heheheh i am from Flash Cheesy";
Then in my flash i have a button, if i clicked that it will control/initialize the textArea id="B" with
the variable "A" from flash in my mxml..

The summary is, how to control method/object/state/whatever in flex with external flash(.swf) which
we place that in SWFLoader in mxml.. Smiley

Nah in mxml we can adjust the textArea id="B" just like this : B.text = "Blahblahblah";

Now how to make the interaction with flash and flex?..

I am sry, i cant do anything about this, its really stuck here.. Smiley

Thank you very much Smiley

« Last Edit: 03/14/10, 19:53 by hinomotoblade » Logged

Huihihi~ Cheesy
hinomotoblade
Seasoned Programmer
***
Posts: 131


Flash Never Die :D


View Profile
« Reply #3 on: 03/16/10, 03:17 »

:O
Logged

Huihihi~ Cheesy
mark40
Server what's that
*
Posts: 1


View Profile Email
« Reply #4 on: 04/06/10, 01:48 »

The code on the page does not work you need to download the source file in order to get a propper code. 
The Greeter.as is ok, but the .fla file is : 
(type this code in the actions layer - if you have one - or in the first keyframe of your fla timeline - if you decided to write the code in the same layer and keyframe with your text field) 
 
/*You need to have your Greeter.as file in a folder named quickstart that is in a folder named example that is in a folder named com that is in the folder with your fla file ... or you can simply remove "com.example.quickstart. " from both the Greeter.as and the HelloWorld.fla code.*/ 
 
import com.example.quickstart.Greeter; 
 
// Create a Greeter instance with the initial name "Steve" 
var myGreeter:Greeter = new Greeter("Steve"); 
// Say hello to Steve 
var steveGreeting:String = myGreeter.sayHello(); 
output.text = steveGreeting; 
// Move the cursor to the next line 
output.appendText("\n"); 
// Set the Greeter instance's name to "Harold" 
myGreeter.name = "Harold"; 
// Say hello to Harold 
var haroldGreeting:String = myGreeter.sayHello(); 
output.appendText(haroldGreeting); 
Logged

mark
mcse
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything