1 person found this helpful
You should be able to do it this way:
sym.$('text').html('<iframe width="550" height="400" src="CompFolderName/index.html"></iframe>');
That doesn't do it. I'm trying to load a page that's completely external, such as Yahoo.com or whatever into a specific container/Symbol on my Stage. The Container is named LIProfileContainer.
Using your answer, I tried:
sym.$('LIProfileContainer').html('<iframe width="720" height="363" src="https://www.yahoo.com"></iframe>');
I also tried:
sym.$('text').html('<iframe width="720" height="363" src="http://www.yahoo.com"></iframe>', 'LIProfileContainer');
However, nothing shows up in the Container. It's still just an empty box.
Let me see that. I have done it before and I can't remember how. Just need to look at my files.
If you could, that would be great. Thanks!
1 person found this helpful
I’ve been using :
sym.getSymbol(“mySymbol").$(“externalURL_holder").html("<iframe width='1024px' height='600px' src=‘myPath/externalURL.html' frameborder='0' margin='0 auto' padding='0' allowfullscreen scrolling='yes'></iframe>");
and it works.
Hi! that question (and answer) are very useful to me. But I have a doubt. I´m web designer and I don´t know where I should write the code in order to work properly. In the stage? inside an element?
I´m use animate for animation, but I want to put a external web (or local) inside the aimate project. Could you help me? there is not enough spanish tutorial about it, almost nothing, actually.
What is "mySymbol" referencing? I've got everything else figured out, but it's still not working, and I think that's my issue.
Bruce, could you tell me where I have to put this code? After this I'll figure out what "my symbols" means .
I'm putting it on the Stage of a Symbol, with a CreationComplete action assigned to it, so that when the Symbol is completed, the external web page loads into a Symbol on the Stage. I've also tried assigning the action to a button so that when someone clicks on it, the web page loads into a Symbol on the Stage, but no luck with that either.
Actually, I got it to work with sym.$('text').html('<iframe width="550" height="400" src="CompFolderName/index.html"></iframe>');
However, that only works with my own site. When I try to use a page from Yahoo, LinkedIn, etc, nothing loads.
Thanks, but I get the same result. The external web page content doesn't load.
Hi resdesign! I tried to put the code:
sym.getSymbol("mySymbol").$("externalURL_holder").html("<iframe width="1024px" height="600px" src="myfolder/index.html" frameborder='0' margin='0 auto' padding='0' allowfullscreen scrolling='yes'></iframe>");
on the symbol stage, but I don´t understand how this code invoke or call to the url web, because "mysymbol" is inside of itself.
Would you mind telling me step by step where to put the code for a html, inside in a folder on the desktop, for instance? Please , I'm stuck and frustrated
I use the code you cote the following way:
1-"mySymbol" is on the Stage
2- "externalURL_holder" is inside of "mySymbol" div . It is there to hold the external html page
3 - The code is triggered by a "click" action binded on a button on Stage
I just saw there was a error with the code : ( a double quote instead of a single cote)
sym.getSymbol("mySymbol").$("externalURL_holder").html("<iframe width='1024px' height='600px' src='//www.imaginatica.com/index.html' frameborder='0' margin='0 auto' padding='0' allowfullscreen scrolling='yes'></iframe>");
Here is an exemple :
Good job, Smenegassi!
Thanks, but due to browser security issues this only works if you are linking to a page on the same server as your EA content. For instance, try it with www.yahoo.com instead. It won't work. Ugh.
Try adding it as a Creation Complete or Composition Ready action to the Stage.
Works! Thanks a million.
Hi, I found a solution with this little piece of code:
I made a rectangle (div) in the main stage, then a symbol called "web" and the element "rectangle". Double click in order to get de symbol stage and paste this code:
var container = sym.$("Rectangle");
var web = '<iframe src="your_folder/your_url_.html" width="'+container.width ()+'" height="'+container.height ()+' " frameborder="0" style="border:0"></iframe> ';
It works with external and local html. Between the brackets "()" you should put in the width and height in pixels f.e.