开发者

Flex 4 with XML photo gallery shows a broken link if no thumbnail is sellected

开发者 https://www.devze.com 2023-02-26 21:39 出处:网络
I\'m creating my first website and I\'m not familiar to Html or CSS or AS3 sou i decided to do it all in Flash Catalyst. It\'s very easy. The problem is the link that i created to bind the datalist co

I'm creating my first website and I'm not familiar to Html or CSS or AS3 sou i decided to do it all in Flash Catalyst. It's very easy. The problem is the link that i created to bind the datalist component to a xml file. and when i select a thumbnail from the gallery it appears in a image placeholder in a larger scale, everything is pretty basic. The problem that i'm having is that i get the larger image placeholder frame and broken link icon. It only disappears when i click one of the thumbnails.

This is the Image placeholder called Galeria_Ilust_Data and it's geting the images from {iLimage_type.ILimage} .

<mx:Image includeIn="TP_Ilust" x="401" y="234" width="578" height="397" id="Galeria_Ilust_Data" source="assets/ilustracao/{iLimage_type.ILimage}" visible="false"/>

Now ther's a declaration that says:

<valueObjects:ILimage_type id="iLimage_type"/>

And a change Handler that says this:

        protected function dataList_Ilust_changeHandler():void
    {
        iLimage_type=Datalist_Ilustracao.selectedItem as ILimage_type;
    }

In the image placeholder i changed the visible=false. That makes the placeholder desapear but i need it do reapear if and only if i click on the thumbnail that is generated by the datalist component called Datalist_Ilustracao.

How do i add that?

I have created this code to try and make a solution of letting it be in the visible=false and adding this Mouse event.

protected function Datalist_Ilustracao_clickHandler(event:MouseEvent):void
    {
        Galeria_Ilust_Data.visible=true;
    }

And it worked, it shows the large image in the placeholder. The problem is when i try and go to other gallery's that i have, and that i used the same process, the broken link comes up again. this is the code that I'm looking at.

<s:Application xmlns:ATE="http://ns.adobe.com/ate/2009" xmlns:ai="http://ns.adobe.com/ai/2009" xmlns:fc="http://ns.adobe.com/flashcatalyst/2009" xmlns:lib="assets.graphics.template_website_1_0.*" xmlns:d="http://ns.adobe.com/fxg/2008/dt" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:flm="http://ns.adobe.com/flame/2008" xmlns:components="components.*" xmlns:graphics="assets.graphics.*" backgroundColor="#FFFFFF" creationComplete="application_creationCompleteHandler()" height="768" preloaderChromeColor="#FFFFFF" width="1024" xmlns:filmilust="services.filmilust.*" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:valueObjects="valueObjects.*" xmlns:filmident="services.filmident.*" xmlns:filmanim="services.filmanim.*" xmlns:filmmodel="services.filmmodel.*" xmlns:filmexper="services.filmexper.*" xmlns:filmwebd="services.filmwebd.*" xmlns:filmdesg="services.filmdesg.*" xmlns:filmmulti="services.filmmulti.*">
<fx:Style source="Main.css"/>
<fx:Script><![CDATA[
    import mx.controls.Alert;
    import mx.events.FlexEvent;
        protected function videoPlayer_completeHandler():void
        {
            const state:String = currentState;
            if ( state == 'Inicio' ) {
                currentState='Home';
            }
            if ( state == 'Inicio' ) {
                Sequence1.play();
            }
        }

        protected function application_creationCompleteHandler():void
        {
            Sequence2.play();
        }


    protected function btn_TrabalhosP_rollOverHandler():void
    {
        const customcomponent11State:String = btn_trabalhos_pessoais.currentState;
            if ( customcomponent11State == 'SemMenu' ) {
                btn_trabalhos_pessoais.currentState='ComMenu';
            }
    }


    protected function btn_TrabalhosP_rollOutHandler():void
    {
        const customcomponent11State:String = btn_trabalhos_pessoais.currentState;
            if ( customcomponent11State == 'ComMenu' ) {
                btn_trabalhos_pessoais.currentState='SemMenu';
            }
    }


    protected function btn_TrabalhosC_rollOverHandler():void
    {
        const customcomponent21State:String = btn_trabalhos_comerciais.currentState;
            if ( customcomponent21State == 'SemMenu' ) {
                btn_trabalhos_comerciais.currentState='ComMenu';
            }
    }


    protected function btn_TrabalhosC_rollOutHandler():void
    {
        const customcomponent21State:String = btn_trabalhos_comerciais.currentState;
            if ( customcomponent21State == 'ComMenu' ) {
                btn_trabalhos_comerciais.currentState='SemMenu';
            }
    }


    protected function button_clickHandler():void
    {
            const state:String = currentState;
            currentState='Home';
        }


    protected function btn_Quemsou_clickHandler():void
    {
            const state:String = currentState;
            currentState='QuemSou';
        }


    protected function emailgoto_clickHandler():void
    {
        if ( currentState == 'Contactos' ) {
                navigateToURL( new URLRequest( encodeURI("mailto:ricardo@ramos-design.net")), "_blank");
            }
    }


    protected function btn_Demoreel_clickHandler():void
    {
        currentState='DemoReel';
    }


    protected function btn_Contactos_clickHandler():void
    {
        currentState='Contactos';
    }


    protected function bot_odeFecharmenu_clickHandler():void
    {
        currentState='Home';
    }



    protected function btn_cv_clickHandler():void
    {
            if ( currentState == 'QuemSou' ) {
                navigateToURL( new URLRequest( encodeURI("http://www.ramos-design.net/pdf/cv2010.pdf")), "_self");
            }
        }


    protected function btn_portfolio_clickHandler():void
    {
            navigateToURL( new URLRequest( encodeURI("http://www.ramos-design.net/pdf/portfolio-2010.pdf")), "_self");
        }


    protected function dataList_Ilust_changeHandler():void
    {
        iLimage_type=Datalist_Ilustracao.selectedItem as ILimage_type;
    }


    protected function dataList_Ident_changeHandler():void
    {
        iDimage_type=Datalist_identidades.selectedItem as IDimage_type;
    }


    protected function dataList_Anim_changeHandler():void
    {
        aNimage_type=Datalist_animacao.selectedItem as ANimage_type;
    }


    protected function dataList_Model_changeHandler():void
    {
        mDimage_type=Datalist_modelacao.selectedItem as MDimage_type;
    }


    protected function dataList_Exper_changeHandler():void
    {
        eXimage_type=Datalist_experimentacao.selectedItem as EXimage_type;
    }


    protected function dataList_WebD_changeHandler():void
    {
        wDimage_type=Datalist_webdesign.selectedItem as WDimage_type;
    }


    protected function dataList_DGraf_changeHandler():void
    {
        dGimage_type=Datalist_designgrafico.selectedItem as DGimage_type;
    }


    protected function dataList_Multi_changeHandler():void
    {
        mUimage_type=Datalist_multimedia.selectedItem as MUimage_type;
    }


    protected function Datalist_Ilustracao_creationCompleteHandler(event:FlexEvent):void
    {
        getDataResult.token = filmIlust.getData();
    }


    protected function Datalist_identidades_creationCompleteHandler(event:FlexEvent):void
    {
        getDataResult2.token = filmIdent.getData();
    }


    protected function Datalist_animacao_creationCompleteHandler(event:FlexEvent):void
    {
        getDataResult3.token = filmAnim.getData();
    }


    protected function Datalist_modelacao_creationCompleteHandler(event:FlexEvent):void
    {
        getDataResult4.token = filmModel.getData();
    }


    protected function Datalist_experimentacao_creationCompleteHandler(event:FlexEvent):void
    {
        getDataResult5.token = filmExper.getData();
    }


    protected function Datalist_webdesign_creationCompleteHandler(event:FlexEvent):void
    {
        getDataResult6.token = filmwebd.getData();
    }


    protected function Datalist_designgrafico_creationCompleteHandler(event:FlexEvent):void
    {
        getDataResult7.token = filmDesg.getData();
    }


    protected function Datalist_multimedia_creationCompleteHandler(event:FlexEvent):void
    {
        getDataResult8.token = filmMulti.getData();
    }

//-------------------------------------------------------------------------------------------------------------------------- protected function Datalist_Ilustracao_clickHandler(event:Mous开发者_StackOverflow社区eEvent):void { Galeria_Ilust_Data.visible=true; }

    protected function Datalist_identidades_clickHandler(event:MouseEvent):void
    {
        Galeria_Ident_Data.visible=true;
    }
    protected function Datalist_animacao_clickHandler(event:MouseEvent):void
    {
        galeria_anim.visible=true;
    }
    protected function Datalist_modelacao_clickHandler(event:MouseEvent):void
    {
        galeria_model.visible=true;
    }
    protected function Datalist_experimentacao_clickHandler(event:MouseEvent):void
    {
        galeria_exper.visible=true;
    }
    protected function Datalist_webdesign_clickHandler(event:MouseEvent):void
    {
        galeria_webd.visible=true;
    }
    protected function Datalist_designgrafico_clickHandler(event:MouseEvent):void
    {
        galeria_dgraf.visible=true;
    }
    protected function Datalist_multimedia_clickHandler(event:MouseEvent):void
    {
        galeria_multi.visible=true;
    }

And the image placeholders:

    <mx:Image includeIn="TP_Ilust" x="401" y="234" width="578" height="397" id="Galeria_Ilust_Data" source="assets/ilustracao/{iLimage_type.ILimage}" visible="false"/>
<mx:Image includeIn="TC_Ident" x="401" y="234" width="578" height="397" id="Galeria_Ident_Data" source="assets/identidades/{iDimage_type.IDimage}" visible="false"/>
<mx:Image includeIn="TP_Anim" x="401" y="234" width="578" height="397" id="galeria_anim" source="assets/animacao/{aNimage_type.ANimage}" visible="false"/>
<mx:Image includeIn="TP_Model3D" x="401" y="234" width="578" height="397" id="galeria_model" source="assets/modelacao/{mDimage_type.MDimage}" visible="false"/>
<mx:Image includeIn="TP_Experim" x="401" y="234" id="galeria_exper" source="assets/experimentacao/{eXimage_type.EXimage}" width="578" height="397" visible="false"/>
<mx:Image includeIn="TC_WebD" x="401" y="234" id="galeria_webd" width="578" height="397" source="assets/web_design/{wDimage_type.WDimage}" visible="false"/>
<mx:Image includeIn="TC_DGraf" x="401" y="234" id="galeria_dgraf" width="578" height="397" source="assets/design_grafico/{dGimage_type.DGimage}" visible="false"/>
<mx:Image includeIn="TC_3dMulti" x="401" y="234" id="galeria_multi" width="578" height="397" source="assets/multimedia/{mUimage_type.MUimage}" visible="false"/>

I think that's all the info.

Do i need to indicate that independently of the state or navigation made, the placeholder's are visible=false and that are only true when i click a thumbnail and go back to false when i close the gallery and specify something?

I'm lost and I'm not getting it.

Well that's why I'm writing this :P

0

精彩评论

暂无评论...
验证码 换一张
取 消