That component architecture is fine.

 

If this works the first time, but not subsequently, that sounds to me like binding is not set up properly.  You do not say how you are passing the selectedIndex value you want into the File2 component. Are you binding?

 

Do you have the {Bindable] metadata tag over the selecteIndex variable in file2?

{Bindable]

Public var iSelectedIndex:int;

 

Are you passing a binding expressing into File2?

<myFile2 iSelectedIndex=”{iSelectedIndex}” …/>

And does iSelectedIndex in File1 have the {Bindable] tag?

 

You should perhaps bind the File2 viewstack’s property to the variable:

<mx:ViewStack selectedIndex=”{iSelectedIndex}”…/>

 

Or are you passing in the value by directly referencing the File2 viwestack selectedIndex property?

 

Tracy

 

 


From: [email protected] [mailto:[email protected]] On Behalf Of arnold_charming
Sent: Friday, August 11, 2006 11:11 AM
To: [email protected]
Subject: [flexcoders] window and firering functions

 

Hi!

I'm stuck :(
I have a file called File.mxml which has inside a custom component
based on a <mx:Panel> called File2.mxml. Inside this new component,
File2.mxml, I have a viewstack with 4 views. Every single view is in
its' own custom component. Something like this:

File2.mxml
----
<mx:ViewStack id="myViews" width="100%" height="100%">
<mx:Panel id="knjigaScreen" width="100%" height="100%">
<view:DodajTehSpec_Knjiga />
</mx:Panel>
<mx:Panel title="" id="tiskovinaScreen" width="100%" height="100%">
<view:DodajTehSpec_Tiskovina />
</mx:Panel>
<mx:Panel width="100%" height="100%" id="dodatekScreen" title="">
<view:DodajTehSpec_Dodatek />
</mx:Panel>
<mx:Panel width="100%" height="100%" id="skatlaScreen" title="">
<view:DodajTehSpec_Skatla />
</mx:Panel>
<mx:Panel width="100%" height="100%" id="raznoScreen" title="">
<view:DodajTehSpec_Razno width="100%" height="100%" "/>
</mx:Panel>
<mx:Panel width="100%" height="100%" id="zgoscenkaScreen" title="">
<view:DodajTehSpec_Zgoscenka width="100%" height="100%""/>
</mx:Panel>
</mx:ViewStack>

But the problem arises when I want to change from one view to another.
>From File1.mxml to File2.mxml I'm passing a variable called 'myVar'
which tells' File2.mxml which view should be shown. But to my luck :(
this only works the first time (when this File2.mxml is generated -
creationComplete event). I tried with shown, hide nearlly everything
but nothing works.
Please tell me what should I do so this will work as it should. Thank you.

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to