To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Product Support > Koolmoves

Reply
 
Thread Tools Search this Thread Display Modes
Old 12-08-2006, 01:33 PM   #1
dniezby
Senior Member
 
Join Date: Jul 2001
Location: Tinley Park, IL
Posts: 702
javascript in Action Script?

For organizational purposes only!

I'm trying to organize some code in my file and was wonder how this would be done. Instead of assigning some actions in the button's UI and some with Actionscript, I wanted to put all of the code in one place.

I want to perform a javascript window pop up for a form on my site and this is what I did, but I'm sure the syntax is off.

How would I assign a javascript command to this button with AS instead of using the button's UI?
Here is the sample code for two of the buttons from the menu.


code:
/* 
###################
MENU BUTTON OPERATIONS
###################
*/
// CONTACT US BUTTON
// Open pop up form for contacting the website personnel.

contactusbtn.onRelease = function () {
// Release Button perform
javascript:winpopup ('file.html');
}

// HOME BUTTON
// Show the home page contentpane and hide irrelevant content.
homebtn.onRelease = function (){
// Hide newspage contentpane.
newspage._visible = false;
}

__________________
My Sites: Gaming Site Nightshade Studios MyKM Tutorials

--------------------------------------------------
What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape
dniezby is offline   Reply With Quote
Old 12-08-2006, 05:28 PM   #2
blanius
KoolMoves Moderator
 
blanius's Avatar
 
Join Date: Jul 2001
Location: Atlanta GA
Posts: 4,911
use getURL to pass a javascript command to the browser
getUrl('javascript:winpopup (\'file.html\')');

I think that's right to use the \ to escape the quotes
blanius is offline   Reply With Quote
Old 12-08-2006, 07:30 PM   #3
dniezby
Senior Member
 
Join Date: Jul 2001
Location: Tinley Park, IL
Posts: 702
Forget it. I just went ahead and went back to using this code.

In the Button's UI:

Code:
javascript:openNewWindow('http://www.thepageIneedopen.html','Title of popup window', 'height=400,width=400,toolbar=no,scrollbars=yes')
And this into the Index Page:
Code:
<script language="JavaScript">
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
newWindow=window.open(URLtoOpen, windowName, windowFeatures); }</script>
It works fine and if should ask the user if they want to allow pop ups from the site if it get's blocked.

I only need the one pop up for the movie but it just hit me. What if I needed another instance?
Any ideas on code change?
__________________
My Sites: Gaming Site Nightshade Studios MyKM Tutorials

--------------------------------------------------
What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape
dniezby is offline   Reply With Quote
Old 12-09-2006, 02:06 AM   #4
blanius
KoolMoves Moderator
 
blanius's Avatar
 
Join Date: Jul 2001
Location: Atlanta GA
Posts: 4,911
just change the window name each time you want a new one....
blanius is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Product Support > Koolmoves

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:59 AM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.