Skip to main content

Microsoft Silverlight

Answered Question Flash in Silverlight 3: Will Flash be able to communicate with Silverlight layer and web page through External Interface or other methods?RSS Feed

(0)

netdragon
netdragon

Member

Member

0 points

1 Posts

Flash in Silverlight 3: Will Flash be able to communicate with Silverlight layer and web page through External Interface or other methods?

I have read on various blogs (e.g. http://www.insideria.com/2008/04/microsoft-announces-support-fo.html)

that Silverlight 3 will support calling in Flash SWFs. What I'm wondering is whether SWF <-> Silverlight communication will be possible when the SWF is loaded inside of Silverlight, not on a seperate OBJECT in the page (which is an obvious yes). Additionally, will Silverlight allow Flash External Interface to pass through to the web page? I imagine for the 2nd part, if the SWF can communicate with Silverlight through External Interface, then EI can pass it through to the page if Silverlight doesn't have the requested method.

 

For instance, if you have a video player written in Silverlight, and call a SWF into the video player, will the SWF be able to change the video player's volume or pause the video player?

chad.campbell
chad.cam...

Participant

Participant

1918 points

332 Posts

Silverlight MVP
Answered Question

Re: Flash in Silverlight 3: Will Flash be able to communicate with Silverlight layer and web page through External Interface or other methods?

You can communicate between Flash and Silverlight now.  Both technologies are browser-based plug-ins.  Because of this, you can communicate through the HTML DOM.

If this answers your question, please select "mark as answer", otherwise, please post a follow up question. Thanks!
Chad Campbell

Author of Silverlight 2.0 in Action Blog: http://cornucopia30.blogspot.com

Bill Reiss
Bill Reiss

Contributor

Contributor

4840 points

919 Posts

Silverlight MVP

Re: Flash in Silverlight 3: Will Flash be able to communicate with Silverlight layer and web page through External Interface or other methods?

netdragon:

I have read on various blogs (e.g. http://www.insideria.com/2008/04/microsoft-announces-support-fo.html)

that Silverlight 3 will support calling in Flash SWFs.

Umm check the date on that article...it's a fake.


Bill Reiss, Coauthor of Hello! Silverlight 3
My blog (rss feed)

rajesh shirpuram
rajesh s...

Contributor

Contributor

2314 points

505 Posts

Re: Re: Flash in Silverlight 3: Will Flash be able to communicate with Silverlight layer and web page through External Interface or other methods?

chad campbell is absolutely right. 

Thanks
Rajesh Shirpuram

(If this has answered your question, please click on "mark as answer" on this post. Thank you!)

tlsrcracer7
tlsrcracer7

Member

Member

4 points

2 Posts

Re: Re: Re: Flash in Silverlight 3: Will Flash be able to communicate with Silverlight layer and web page through External Interface or other methods?

What if I have a Listbox that is dynamically filled from a list of objects.  Each object contains an address to a different flash video.  I would like to have a button (on each ListBoxItem) or something the user could click on the play each different flash video.  Is this possible?

tlsrcracer7
tlsrcracer7

Member

Member

4 points

2 Posts

Re: Re: Re: Flash in Silverlight 3: Will Flash be able to communicate with Silverlight layer and web page through External Interface or other methods?

Another question about dynamically filling a listbox.  Some of the objects have fields that have no value (either string.empty or null).  If this is the case, I don't really want to display anything for these fields in the ListBoxItem.  Is there a way to set the visiblity of part of the item template to Collapsed if the field that is supposed to go there is null or empty?

 

For example: If I have a listbox, and I say ListBox.ItemsSource = List<customObject>();
Then I have an ItemTemplate defined for the ListBox that displays things like FirstName, LastName, Email, etc. etc.  Well if the customObject does not have an email address, I don't want to display the Email address or the 'Email: ' textblock.
The template would look like this:
First Name: <customObject.FirstName>
Last Name: <customObject.LastName>
Email: <customObject.Email>

Xaml would look like this:
<StackPanel Orientation="Horizontal">
          <TextBlock Text="First Name: "/>
          <TextBlock Text="{Binding Path=FirstName}"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
          <TextBlock Text="Last Name: "/>
          <TextBlock Text="{Binding Path=LastName}"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
          <TextBlock Text="Email: "/>
          <TextBlock Text="{Binding Path=Email}"/>
</StackPanel>

Is there a way to do this?
Thanks!

bitPusher
bitPusher

Member

Member

2 points

1 Posts

Re: Re: Re: Flash in Silverlight 3: Will Flash be able to communicate with Silverlight layer and web page through External Interface or other methods?

use an IValueConverter bound to your value field to set the visibility. common technique.

tlsrcracer7:

Another question about dynamically filling a listbox.  Some of the objects have fields that have no value (either string.empty or null).  If this is the case, I don't really want to display anything for these fields in the ListBoxItem.  Is there a way to set the visiblity of part of the item template to Collapsed if the field that is supposed to go there is null or empty?

 

For example: If I have a listbox, and I say ListBox.ItemsSource = List<customObject>();
Then I have an ItemTemplate defined for the ListBox that displays things like FirstName, LastName, Email, etc. etc.  Well if the customObject does not have an email address, I don't want to display the Email address or the 'Email: ' textblock.
The template would look like this:
First Name: <customObject.FirstName>
Last Name: <customObject.LastName>
Email: <customObject.Email>

Xaml would look like this:
<StackPanel Orientation="Horizontal">
          <TextBlock Text="First Name: "/>
          <TextBlock Text="{Binding Path=FirstName}"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
          <TextBlock Text="Last Name: "/>
          <TextBlock Text="{Binding Path=LastName}"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
          <TextBlock Text="Email: "/>
          <TextBlock Text="{Binding Path=Email}"/>
</StackPanel>

Is there a way to do this?
Thanks!

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities