flash actionscript:
From within one Flash movie, I'd like to open another browser window containing a different Flash movie. The movie opens just fine, but I'd like to deactivate the menu bar, address bar, and toolbar. Questions: ? Can I control/set these elements? ? Should this be done with AS? With JavaScript? ? I've heard that using JS to perform such a task is problematic in some browsers? Any help shedding light on these questions is greatly appreciated. Octothorpe
You can control them from JS. Never use AS, it sucks and is propretary. Flash is crrap and not a real development platform. stick to HTML,CS,JS,AJAX as much as posssible. window.open has the params you want, and I've never heard of them having a problem. Use JS to call it.
I'm not 100% sure, but I think this is what you need, it worked for me. Put this in the action script: on (press) { getURL("javascript:openNewWindow('?????.html','thewin','height=400,width=400,to olbar=no,scrollbars=yes')", "_blank"); } Specify your own window size, scroll bar yes/no, etc. Hope this helps
on (press) { getURL("javascript:openNewWindow('????.html','thewin','height=400,width=400,toolbar=no,scrollbars=no')", "_blank"); } I tried this, it doesn't work any suggestions?
I would suggest getting yourself a javascript primer if you're going to do any sort of web programming. I've found some free tutorials hosted by http://www.w3schools.com/ really helps. Second, it looks like Dave's script is using a javascript function that's he's added to the page, it's not part of the standard javascript library. The real javascript command is window.open(params). There are many many examples on the web of how to do this given the right search. Just be aware that it's real easy to get confused on the quotes and parentheses required for any getURL command that calls javascript.
use window.open(....) not openNewWindow it doesn't exist... I suggest you to call a Js function in your html file to open a pop-up; so this way you can code exceptions depending on the user-agent. If you really want your pop-up in Flash use this syntax : getURL("javascript:window.open('yourHtmlFile.html','someIdToRefer','width=200, height=400, location=no, menubar=no, resizable=no, scrollbars=no, status=yes, toolbar=no, titlebar=yes')");
We've already had to make a decision that addresses my initial question, but I'm still curious about whether or not there's a problem using JavaScript from within Flash on certain browsers. Is this correct? Is it inadvisable to use JavaScript from within Flash?
At my company, we do a lot of actionscript/javascript communication. I don't think it's inadvisable to call javascript from within flash. You need to do whatever the situation warrants using the right technology having the cleanest/easiest to maintain code possible. Sometimes there won't be any other way. Yes, javascript does perform differently on different browsers, but it's getting more standardized than it was in the past. That being said, I would definitely suggest using the ExternalInterface library from within flash as the best way to communicate with javascript. Good luck
Don't see what you're looking for? Try a search.
|