creating a (flash) html popop using existing code

In a site I am working on a javascript is used to create fixed sized popup's. I would like to use the same script to create fixed sized popup's from within a flash file.

The Code that is used in the HTML is the folowing.
--------
<script language="JavaScript" type="text/JavaScript">
<!--

var win=null;
function NewWindowScroll(mypage,myname,w,h,pos,infocus){
        if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
        if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
        else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
        settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes";
        win=window.open(mypage,"popup",settings);
        win.focus();
}

function NewWindow(mypage,myname,w,h,pos,infocus){
        if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
        if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
        else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
        settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";
        win=window.open(mypage,"popup",settings);
        win.focus();
}
//-->
</script>
---------

The HTML link that uses this script looks like this
---------
<a href="javascript:NewWindowScroll('link.html','','400','300','center','front');">link<br/></a>
---------

I want to use the same script in a flash button to launch a new window with a fixed size.  
Can anyone help me out with this one line of code.

Thanks a lot,

Anton
AntonatworkAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sokhodomCommented:
Have you tried getURL?

on(release) {
getURL("javascript:NewWindowScroll('link.html','','400','300','center','front')");
}
0
AntonatworkAuthor Commented:
I did not reall know how to combine the get URL thing and the Javascript.
The anwser you have given me does not contain an URL. I have tried the following.

on(release) {
getURL("http://www.test.com/test.html","javascript:NewWindowScroll('link.html','','400',300','center','front')");
}

But i does not work.
I just get a new screen, but nothing special like a fixed size or a 400 x 300 resolution.

Is there something wrong with my code?



0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

AntonatworkAuthor Commented:
No this is also not helpfull. This get URL really has to work together with the javascript mentioned in the first post.
I have no access to the index file, so I cannot change the javascript

0
negatyveCommented:
Is the flash movie embedded in the same page where the javascript function is defined?
0
AntonatworkAuthor Commented:
yes
0
vickerleungCommented:
Anton,

try the following~

getURL("javascript:NewWindowScroll('http://www.test.com/test.html','','400','300','center','front')");

Vicker
0
DavidCrossmanCommented:
Anton:

Don't know if you've figured this out yet, but an easy solution might be as follows:

Include the fscommand code in the HTML page that includes the Flash file.

From Flash, use:
fscommand("myFunction","myLink");

In the Javascript then, within the function declared as:
function myFile_DoFSCommand(command, args)

If it's not already there, add:
      var myArgs = new String(args);
      var cmd = new String(command);

Then, a simple if statement:
if (cmd == "myFunction") {
   NewWindowScroll(myArgs,'','400',300','center','front');
}

args can also be an array, if you want to send more than one parameter.

Hope this helps, this question has been idle for a while.

David Crossman
-=-



0
DarthModCommented:
PAQed with no points refunded (of 500)

DarthMod
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.