Create an instance of WebYouTubeMovie on the fly

I want to add and create an instance of WebYouTubeMovie’s on the fly in my webapp after the app is running.
Is this possible? I’m am doing the following and it does not work.

Dim videoplayer1 as New WebYouTubeMovie

Thanks in advanced,

That’s interesting, I’ve been trying to add a new WebYouTubeMovie in a control array to the WebPage but it doesn’t seem to be working for me either… Also your item must be in a control array (control set now?) either way, if you try and do it the way you’re doing right now, the new control’s parent never gets set, which I believe is the reason why you can’t see it once you create it and since .parent is read-only you can’t set it "on the fly/at runtime).

The way I’m trying to do it doesn’t seem to be working either, so maybe one of the many veterans of Web Edition can help resolve this mystery, I’m curious too =)

dim myYTMovie As WebYouTubeMovie
dim count as Integer = YTMArray.Ubound

myYTMovie = New YTM // my "template" WebYouTubeMovie control on the window (YTM).

//Here I set all the properties of the new control = 100
myYTMovie.left = 50
myYTMovie.Width = 200
myYTMovie.Height = 100
myYTMovie.URL = ""
myYTMovie.Visible = True

YTMArray.Append myYTMovie

Label1.Text = str(count)

So I’m not seeing why it’s not working, at least the first item should show up no matter what, as I know that’s on the page already and I move it into a visible area of the web page… I know the code isn’t correct to add more than one since I’m hard coding the left/top properties but I’m doing it as a test.

As a property of WebPage1

YTMArray(-1) As WebYouTubeMovie

Any other clues?

Use a WebContainer?

That could be a good workaround, but one would expect to not have to put every GUI item in a WebContainer that you’d like to have dynamic copies made… of course I personally should stop replying as I feel like I’m hijacking the thread.

Unfortunately, using a webcontainer really is the best solution right now.

[quote=69226:@Greg O’Lone]Unfortunately, using a webcontainer really is the best solution right now.

You might find the WEYouTubePlayer in Studio Stable WebEssential slightly better than using a WebContainer. See the demo. Click #2 at top left, then YouTube at top right:

Full source is included when you purchase a license.