如果未提供缩略图,则带有XML照片库的Flex 4显示断开的链接

| 我正在创建自己的第一个网站,但对HTML,CSS或AS3并不熟悉,因此我决定在Flash Catalyst中完成所有操作。非常简单。问题是我创建的将数据列表组件绑定到xml文件的链接。当我从图库中选择缩略图时,它会以较大比例显示在图像占位符中,这一切都非常基本。 我遇到的问题是我得到了较大的图像占位符框架和断开的链接图标。 仅当我单击其中一个缩略图时,它才会消失。 这是一个名为Galeria_Ilust_Data的图像占位符,它是从{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\"/>
现在,这是一条声明:
<valueObjects:ILimage_type id=\"iLimage_type\"/>
而一个更改处理程序说:
        protected function dataList_Ilust_changeHandler():void
    {
        iLimage_type=Datalist_Ilustracao.selectedItem as ILimage_type;
    }
在图像占位符中,我更改了visible = false。 这使占位符消失,但仅当我单击由称为Datalist_Ilustracao的数据列表组件生成的缩略图时,我才需要重新显示该占位符。 我该如何添加? 我创建了此代码,以尝试制定一种解决方案,将其设置为visible = false并添加此Mouse事件。
protected function Datalist_Ilustracao_clickHandler(event:MouseEvent):void
    {
        Galeria_Ilust_Data.visible=true;
    }
它起作用了,它显示了占位符中的大图像。 问题是当我尝试去其他画廊,并且我使用相同的过程时,断开的链接再次出现。 这是我正在查看的代码。
<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();
    }
// ------------------------------------------------ -------------------------------------------------- ------------------------         受保护的函数Datalist_Ilustracao_clickHandler(event:MouseEvent):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;
    }
和图像占位符:
    <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\"/>
我认为这就是所有信息。 我是否需要表明与状态或导航无关的占位符是visible = false,并且仅当我单击缩略图时才为真,而当我关闭画廊并指定一些东西时才返回false。 我迷路了,我不明白。 那就是为什么我要写这个:P     
已邀请:

要回复问题请先登录注册