⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iframedemo.mxml

📁 flex 事 例
💻 MXML
字号:
<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*" creationComplete="initTree(); iFrame.visible=true" viewSourceURL="srcview/index.html"> 

    <mx:HBox width="100%" height="100%">

        <mx:Panel title="Tree" width="200" height="100%" panelBorderStyle="roundCorners">
            <mx:Tree id="tree" width="100%" height="100%" dataProvider="{content}"
                     change="iFrame.source=tree.selectedNode.path"  />
        </mx:Panel>

        <mx:Panel width="100%" height="100%" title="Content" marginTop="1" marginBottom="1" marginLeft="1" marginRight="1" >
            <IFrame id="iFrame" source="http://blog.eshangrao.com" width="100%" height="100%"  />
            <mx:ControlBar>
                <mx:CheckBox id="cbVisible" label="IFrame Visible" selected="true" click="iFrame.visible=cbVisible.selected"/>
            </mx:ControlBar>

        </mx:Panel>

    </mx:HBox>

    <mx:Script>
    <![CDATA[

    import mx.collections.ArrayCollection;

    // TODO: determine whether we can go back to using the XML object in MXML, which
    // is much less verbose than the initTree() function below.  This was changed
    // because using the XML object as the data provider to a Tree looks very 
    // strange in 2.0.  Still need to investigate using ITreeDataDescriptor or
    // need to ask others on the recommended approach here.

    [Bindable]
    public var content:ArrayCollection;

    private function initTree()
    {
        content = new ArrayCollection();

        var googleItem:Object = new Object();
        googleItem.label = 'Google';
        googleItem.path = 'http://www.google.com';
        var yahooItem:Object = new Object();
        yahooItem.label = 'Yahoo';
        yahooItem.path = 'http://www.yahoo.com';
        var searchItem:Object = new Object();
        searchItem.label = 'Search';
        searchItem.children = [googleItem, yahooItem];
        content.addItem(searchItem);

        var adobeItem:Object = new Object();
        adobeItem.label = 'Adobe';
        adobeItem.path = 'http://www.adobe.com';
        var softwareItem:Object = new Object();
        softwareItem.label = 'Software';
        softwareItem.children = [adobeItem];
        content.addItem(softwareItem);
        
        // TODO: add some links here to Flex sites
    }
    ]]>

    </mx:Script>

</mx:Application>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -