Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pop up window 1

Status
Not open for further replies.

law78

Technical User
Apr 23, 2004
78
GB
Hi people,

I have created a couple of links in my flash site that link to html pop up's, I have tried adding the same link but to text embedded within a movie clip (scroll pane) that loads from an external swf file (located on level_1)

The pop up shows up but not the size that I wanted it to, the width seems to be a similar size to the width of the movie clip, just wondering if that might be the problem and how to over come it.

Iif you click on flashjob the pop then on Students click here to register, you will see the problem, the width is supposed to be 780px.


Here is the code I used which works for button located on the root timeline.

Code:
on (release){
	Movieclip.prototype.openWin2 = function(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable){
		getURL("javascript:var myWin2; if(!myWin2 || myWin2.closed){myWin2 = window.open('"+url+"', '"+winName+"', '"+"width="+w+", height="+h+", toolbar="+toolbar+", location="+location+", directories="+directories+", status="+status+", menubar="+menubar+", scrollbars="+scrollbars+", resizable="+resizable+", top='+0+', left='+150+'"+"')} else{myWin2.focus();};void(0);");
	};
	
	address = "[URL unfurl="true"]http://secure1.mppglobal.com/web/affiliates/affiliate_144/user/frameslogin.htm";[/URL]
	winName = "students";
	width = 780;
	height = 580;
	toolbar = 0;
	location = 0;
	directories = 0;
	status = 0;
	menubar = 0;
	scrollbars = 0;
	resizable = 0;
	openWin2(address,winName,width,height,toolbar,location,directories,status,menubar,scrollbars,resizable);
}
 
These forums are pretty lonely these days, what's happened?
 
Personally I would put the javascript in the html page. Obviously it is working (partially) where you have it, but I think you will get a more uniform result by putting it in the host html page (of your flash movie).

So for example in your html page.

Code:
<script language="javascript">
function popWindow(address,winName,features){
   window.open(address,winName,features);
}

Then on your button in flash:

Code:
on(release){
   address = "[URL unfurl="true"]http://secure1.mppglobal.com/web/affiliates/affiliate_144/user/frameslogin.htm";[/URL]
    winName = "students";
    width = 780;
    height = 580;
    toolbar = 0;
    location = 0;
    directories = 0;
    status = 0;
    menubar = 0;
    scrollbars = 0;
    resizable = 0;
   
   getURL("javascript:popWindow('"+address"','"+winName+"','width="+width+",height="+height+",toolbar="+toolbar+",directories ="+directories+",status="+status+"')); //etc...
}

--or--

It might work the way you have it if you place the variable assignments before the getURL function.

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
I've been working on this all day and I still can't figure it out.

The link is contained within a movie clip that is called from a scroll pane component, does anyone know of any know issues?

Its driving me crazy...
 
Can you post your .fla?

Wow JT that almost looked like you knew what you were doing!
 
yeah sure.....

give me a minute.
 
Will have a look at it. Getting ready to leave work for the day, but will try to look at it at home tonight.
 
Sure no problem, appreciate the help.

Thanks
 
Trying to look at it now... have you successfully implemented this before or is this method just a theory?

I am asking because this seems to be a very problematic method.

Wow JT that almost looked like you knew what you were doing!
 
OK I think I've got it. You are going to laugh...

You are using reserved names to assign your values. (width, height, etc...) So what is happening is Flash is inserting the width of the MC (width="+width) into the width variable (which happens to be 270). So it is opening the new window at that width. Solution... add a "my" in front of all of your feature variable assignments.

Code:
    mywidth = 780;
    myheight = 580;
    mytoolbar = 0;
    mylocation = 0;
    mydirectories = 0;
    mystatus = 0;
    mymenubar = 0;
    myscrollbars = 0;
    myresizable = 0;
            
openWin2(address,winName,[highlight]mywidth,myheight,mytoolbar,mylocation,mydirectories,mystatus,mymenubar,myscrollbars,myresizable[/highlight]);

I actually did a lot more to get it to work in a way that I though was flawless, but I think you can modify your code as above and that will do it. If it still doesn't work let me know.

Hope that helps!

Wow JT that almost looked like you knew what you were doing!
 
I'll try that pix8r, will post back and let you knwo....

Thanks
 
Works a treat, thanks for your help :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top