Click to See Complete Forum and Search --> : Actionscript newbie help


agalloch
10-01-2010, 10:45 AM
I'm trying to basically convert my javascript in html to actionscript in flash. I have a field with a button. When a person presses the button, I want it to go to www.website.com + field.value... Here's what I have so far, not working though. Probably because I just took window.open from the JS and don't know what works and what doesn't in actionscript.

CheckLocationButton.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage);

function fl_ClickToGoToWebPage(event:MouseEvent):void
{

window.open('http://website.com/' + locationField.value,'windowname','width=800,height=600,scrollbars=yes,resizable');
}

Eye for Video
10-01-2010, 12:42 PM
This may or may not be of help but here's what I use (AS2):
Flash popup window

Put this in the <head> of your html web page:
<script language="JavaScript">
function openWin(url, w, h)
{
var winprop = "width=" + w + ",height=" + h;
openwin = window.open(url,'',winprop);
}
</script>
and this in your button AS:

getURL ("JavaScript:openWin('http://www.citradingcards.com/olymarine/video_library/crab_fest.html', '475', '475')");

adjust as needed for your own page.

Best wishes,
Eye for Video
www.cidigitalmedia.com

radbourn3
10-01-2010, 06:28 PM
Pretty similar with AS3 except the getURL is now a URLRequest. Give it a quick google and there's bound to be an example URLRequest to look at.