SKITSANOS FOR RIA

Skitsanos

Friday, May 16, 2008

Flash/actionscript 3 open url into an iframe

I just got an alert about this post where guys discussing open URL into an iframe. Yea, thing will work, but as long as you doing just one URL per time.

My recommendation, - don't use this navigateUrl method, instead "talk" to your JavaScript, like I do in following example:

for (var i:Number = 0; i<listRates.dataProvider.length; i++)
{
if (listRates.dataProvider[i].selected == true)
{
trace("url:" + listRates.dataProvider[i].url + "&checkin=" +
dateArrival.text + "&checkout=" + dateDeparture.text);
ExternalInterface.call("window.open", listRates.dataProvider[i].url +
"&c1=" + date1.text + "&c2=" + date2.text, "checkProvider" + i);
}
}


Want to know why? Simple, Once you trying to do navigateUrl within a loop you application might accidentally lose the action and "forget" to open some of the browser windows your requested in this loop. So once you do it via ExternalInterface, you won't have problems anymore, leave some work to do for the browser as well, don't be greedy.

3 comments:

von said...

Hey can you walk me through it I don't grasp it yet.

maybe if you could discuss the code
and reference the navigateToURL.

thanks

I was on that other forum and didn't find much help.

von said...

Hey can you walk me through it I don't grasp it yet.

maybe if you could discuss the code
and reference the navigateToURL.

thanks

I was on that other forum and didn't find much help.

von said...

Hey can you walk me through it I don't grasp it yet.

maybe if you could discuss the code
and reference the navigateToURL.

thanks

I was on that other forum and didn't find much help.

Webware development dedicated blog by Skitsanos R&D Labs. ASP.NET, XML, RIA, Adobe Flex, ActionScript 3, AIR, AJAX, Web 2.0, Backbase, CGI development with RealBasic and other web development issues.
News
Downloads