Use a variable to display external video in an Iframe

Apr 09, 2024

Hello,

I think I know the answer to this but thought I'd ask. Is it possible to utilize a variable within iFrame code of an external video? I have 110 unique videos a client would like to have access to. Instead of doing each one separately, it would be great to just create one slide that uses a variable inside the iframe string. I could then copy and paste that slide 109 times just changing and passing variable into the string. Used to be able to do it with Authorware, Director and Flash but I don't think SL is there yet. 

Guess I'm just a efficient/lazy developer!

2 Replies
Walt Hamilton

You know what they say when you are looking for efficiency, “Choose your laziest man to do a task the first time, then make everybody else do it the same way he does.”

It seems to me that if you could use a variable, which I don’t think you can, you wouldn’t need 110 slides. Just one would do the trick, but you would have to create 110 triggers to change the variable. You’d have to change the name every time, whether you use different slides, or just change the variable, so just duplicating the slide might not be the worst idea. Dupe the original 10 times, then select those 10 and dupe them. Duplicate, don’t copy and paste.

I’m not even sure you could do it with JS, But then, I don’t know everything.

Dave Strobl

Hi Walt. Yes, if I could use variables I could likely do the entire project in 2 slides. One for the user to select the video option and the other to display the content. I miss the good old days of Authorware. I could have created a repeat loop that would create, name and position all 110 buttons then using the button name, parse a string that could be then passed to display the content. All the names could have been housed in an editable external file read by the code. If anything changed or was added, the code wouldn't have had to be touched!