jordiaseques
09-11-2009, 09:06 PM
I want to shot a popup with a TitleWindow. Depending on the picture should be a TitleWindow with borderStyler=”none” or borderStyle=”true”.
With the first 10 pictures I want borderStyle=”none”
Next pictures I want borderStyle=”true”
How can I do it? I wrote the code to give more information:
in my principal mxml when I press a button it goes to the next event:
private function Triarfoto(event:MouseEvent):void
{
Iddelboton= event.target.id;
fotonumero=Iddelboton.substring(4,6);
nombrefoto="foto"+fotonumero+".jpg";
centradox=Number(Iddelboton.substring(17,20));
centradoy=Number(Iddelboton.substring(21,24));
nomprofe=matriunoms[Number(fotonumero)-1];
PopUpManager.addPopUp( new DisparaPopUp2(), this, true);
}
The most important now is the var nombrefoto. Nombrefoto can get the next values:
foto01.jpg
foto02.jpg
foto03.jpg
...
foto20.jpg
...
in the next code I explain how is DisparaPopUp2.mxml :
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" showCloseButton = "true" layout="vertical" creationComplete="centerMe()"
close="PopUpManager.removePopUp(this);" xmlns:local="*" borderStyle="none" borderColor="#FFFFF" backgroundColor="#FFFFFF">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import mx.core.Application;
public function centerMe():void
{
this.move(Application.application.centradox,Applic ation.application.centradoy);
}
]]>
</mx:Script>
<mx:ModuleLoader url="Modulfotos2.swf" /> // Here goes to charge the photo
</mx:TitleWindow>
Can you help me please?
Thanks
Jordi
With the first 10 pictures I want borderStyle=”none”
Next pictures I want borderStyle=”true”
How can I do it? I wrote the code to give more information:
in my principal mxml when I press a button it goes to the next event:
private function Triarfoto(event:MouseEvent):void
{
Iddelboton= event.target.id;
fotonumero=Iddelboton.substring(4,6);
nombrefoto="foto"+fotonumero+".jpg";
centradox=Number(Iddelboton.substring(17,20));
centradoy=Number(Iddelboton.substring(21,24));
nomprofe=matriunoms[Number(fotonumero)-1];
PopUpManager.addPopUp( new DisparaPopUp2(), this, true);
}
The most important now is the var nombrefoto. Nombrefoto can get the next values:
foto01.jpg
foto02.jpg
foto03.jpg
...
foto20.jpg
...
in the next code I explain how is DisparaPopUp2.mxml :
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" showCloseButton = "true" layout="vertical" creationComplete="centerMe()"
close="PopUpManager.removePopUp(this);" xmlns:local="*" borderStyle="none" borderColor="#FFFFF" backgroundColor="#FFFFFF">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import mx.core.Application;
public function centerMe():void
{
this.move(Application.application.centradox,Applic ation.application.centradoy);
}
]]>
</mx:Script>
<mx:ModuleLoader url="Modulfotos2.swf" /> // Here goes to charge the photo
</mx:TitleWindow>
Can you help me please?
Thanks
Jordi