Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-15-2006, 03:19 PM   #1
stonyx
Registered User
 
stonyx's Avatar
 
Join Date: Jun 2006
Posts: 54
Default call swf from datagrid

hi coders, how can i call SWFLoader only if there is a swf in the XML
my XML sometimes has <desc> as description (only text)
and sometimes <video> could be swf or flv
everything is ok if all the <book> tags have a <video> tag but if there is no <video> it will throw an error
Quote:
<catalog>
<book>
<name></name>
<desc></desc>
</book>
<book>
<name></name>
<video></video>
</book>
</catalog>
Quote:
<mx: DataGrid dataProvider="{xlc}"
width="161" id="datagrid" scroll="true" height="531" x="5" showScrollTips="true" variableRowHeight="true" y="4" >

<mx:SWFLoader x="10" y="118" width="546" height="294.5"
source="{datagrid.selectedItem.video.*}"/>

<mx:TextArea id="areaDeTexto" width="560" height="414" htmlText="{datagrid.selectedItem.desc}" x="3" y="3"/>
help
stonyx is offline   Reply With Quote
Old 08-15-2006, 05:04 PM   #2
Tink
Addict
 
Tink's Avatar
 
Join Date: Nov 2001
Location: London
Posts: 2,128
Default

Code:
<mx: DataGrid dataProvider="{xlc}"
width="161" id="datagrid" scroll="true" height="531" x="5" showScrollTips="true" variableRowHeight="true" y="4" change=onDataGridChange( event );>

<mx:SWFLoader id="myLoader" x="10" y="118" width="546" height="294.5" >
then in AS
Code:
private function onDataGridChange( event:Event ):void
{
if( datagrid.selectedItem.video ) myLoader.source = datagrid.selectedItem.video;
}
Tink is offline   Reply With Quote
Old 08-16-2006, 06:57 PM   #3
stonyx
Registered User
 
stonyx's Avatar
 
Join Date: Jun 2006
Posts: 54
Default

Gracias Tink
stonyx is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrid Scrolling bug? Column repeats over and over while mouse is pressed... diesel5599 Components 2 12-18-2006 04:34 PM
onLoad function call things... Grofit ActionScript 2.0 12 08-01-2006 11:56 PM
Please help loading data/ datagrid ericb1 Components 1 11-22-2005 07:26 PM
[Q] How do I make this server call in Flash??? CyanBlue ActionScript 2.0 8 03-15-2005 09:43 PM
inheritance - Mortimer Jazz ActionScript 1.0 (and below) 10 07-24-2003 09:51 PM


All times are GMT. The time now is 11:30 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.