Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Problem accessing public function in another module

Avatar

Avatar
Level 1
karanaso
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
karanaso
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
karanaso
Level 1

13-07-2008

Hi there,



I have only started working with Flex 3 only couple of days
ago. I am a Delphi experienced programmer if that helps.

I have created a small Flex Project which contains 3 Flex
modules. The modules are not loaded as SWF files but with the
<local:......>.



My modules are data-aware and they work fine on the first
change state. I am also able to update my data by pressing a
button.



I have two big problems I hope you gurus could help me.

1. Is it possible to access a public function written in a
different module ? (Once again I state that I load the modules
using the <local:formname/>

2. Is it possible to execute an action when I change the
currentState because my script only fires only with the
creationComplete which triggers the first time.



my module code looks like

<mx:Module xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" width="780" height="560"
creationComplete="doInit()" >



public function doInit():void

{

Alert.show('hi');

rs = new HTTPService;

rs.url=myurl;

rs.method="POST";

rs.addEventListener("result",resultHandler);

rs.addEventListener("fault",faultHandler);

rs.send();



}



...

..

..

..

</mx:Module>



Thank you all guys and really really sry for being such a
n00b 😞 😞 😞 🙂 :(:(:(

Sotiris/Greece

Replies

Avatar

Avatar
Affirm 1
Level 2
atta707
Level 2

Likes

0 likes

Total Posts

30 posts

Correct Reply

2 solutions
Top badges earned
Affirm 1
View profile

Avatar
Affirm 1
Level 2
atta707
Level 2

Likes

0 likes

Total Posts

30 posts

Correct Reply

2 solutions
Top badges earned
Affirm 1
View profile
atta707
Level 2

14-07-2008

have you tried



<local:formname id="fn"/>



and then in your script this.fn.doInit() should work!



Do you have the event on which you're chaning the
currentState? If so, that would be place to add more logic.



For a more graceful solution of the latter take a look at the
enterState and exitState event of the State class.



By the way, are you sure why are you using 'modules' versus
custom components here?



ATTA

Avatar

Avatar
Level 1
karanaso
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
karanaso
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
karanaso
Level 1

14-07-2008

Hi again,



First of all let me thank you for taking you time with me...

I tried the id-thing unsuccesfully, I have uploaded my source
at mywebsite (
http://www.sekdev.com/test/Ermineia.rar)
I hope you could take a look. Having said that 🙂 🙂 could you
plese provide with an example of how this.func() would work on
seperate states. Or an example how I can fire an event on change
state within the different module or how from the mail application
I can fire a function that resides within a module.



Feeling stup.....id at 32 is a really bad feeling man 🙂 🙂

Plz help and thx again 🙂



Sotiris/Greece