|
-
Pop-up from a Contentpane?
Anyone know if it's possible for me to launch a pop-up (for a Flash Webform) from a contentpane?
I put this into the content pane
Code:
<A HREF="javascript:popUp('./webforms/founders_form.html')">Open the Popup Window</A>
It shows up properly in the contentpane but doesn't open the form.
I put this code into the HTML page that needs to open.
Code:
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=400');");
}
// End -->
</script>
-
KoolMoves Moderator
The popup javascript has to be in the link. Won't ever see it in the page. Try putting:
javascript:day = new Date();id = day.getTime();eval("page" + id + " = window.open('./webforms/founders_form.html', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,men ubar=0,resizable=0,width=300,height=400');");
in your link instead. I think that will run the javascript in the CURRENT HTML page that your SWF is located. Thus it will open a new window(window.open)
-
Did you try getting this to work?
I put this into a contentpane...Is it what you meant?
Code:
<a href="javascript:day = new Date();id = day.getTime();eval("page" + id + " = window.open('./webforms/founders_form.html', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,men ubar=0,resizable=0,width=300,height=400');");">Click this link</a>
What happens is a white box appears in the contentpane without any text.
The contentpane HAS HTML is checked.
Do you think it would make a difference if I link to an actual HTML page instead of actually typing the html into the box?...I'll try that and let you know the results. In the meantime if you can think of anything else, please let me know.
-
quick update - nope...
Tried putting the javascript code into an external HTML page that the contentpane loads and that didn't work either...In fact, none of the code or text showed up beyond the opening <a
Then I decided to try putting the script into the loaded html page and it looked like it was going to work but it didn't. The link DID show up this time but clicking the link did nothing.
One thing I did notice is that the contentpane seemed to translate the script into blank lines.
-
Can't Re- Member
This is the same... but it's html/javascript, there is no way to do this within flash without making your movie huge with a long download time.
<SCRIPT TYPE="text/javascript">
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
return false;
}
//-->
</SCRIPT>
You must put this into the header tags in the html holder, on inside whatever html link you are using.
humanus somes est divinitus in ipsum
Wiliiam Wallace
-
KoolMoves Moderator
Did some testing on my own. Looks like a no go.
-
Yeah, I've tried everything under the sun. It doesn't work from the contentpane.
I've moved on to trying to figure out if there is a way for the contentpane to signal that the user has scrolled to the end, then perform an action.
EG:
The user scrolls down reading the agreement. When the user scrolls down to the final line the condition results in true and now unhides a button. Sort of like some of the software license agreements where you can't continue with the installation until you've scrolled all the way down.
-
KoolMoves Moderator
I'm sure that can be done.
-
Can't Re- Member
The pane accepts html but I think it ignores javascript,, there must be a way to do this in straight html without java script. In the mean time,, try putting this in the counterpane...
<A HREF="javascript opup()">window.</A>
and this in the html of the window you want to open.
<SCRIPT language="JavaScript"><!--
function popup(){
cuteLittleWindow = window.open("page.html", "window", "location=no,width=320,height=200");
}
//--></SCRIPT>
I have my doubts and haven't tried this but,,,,,,, good luck
humanus somes est divinitus in ipsum
Wiliiam Wallace
-
 Originally Posted by blanius
I'm sure that can be done.
Do you think I should create a new post to raise this question to the masses?
-
KoolMoves Moderator
had to dig around in Wilburt's code to find it (wish He's comment his code )
You can get the content pane's Max scroll with contentpane1.vs._max
and you can get the conent pane's Current scroll with contentpane1.vs._cur
Make sure it's loaded first, and then when _cur=_max you are there.
-
 Originally Posted by blanius
had to dig around in Wilburt's code to find it (wish He's comment his code  )
You can get the content pane's Max scroll with contentpane1.vs._max
and you can get the conent pane's Current scroll with contentpane1.vs._cur
Make sure it's loaded first, and then when _cur=_max you are there.
Who's code?
-
KoolMoves Moderator
Wilburt is the Brants on the forum he wrote the code for the content pane.
But those work I just tested it.
-
KoolMoves Moderator
-
Last edited by dniezby; 12-18-2005 at 11:23 PM.
Reason: You already answered this one
-
Is the code supposed to be in a Movie Clip or did you just put it in there so it'd be easier to follow?
-
KoolMoves Moderator
I do that for code I want to execute all the time.. Just one way to do it.
-
KoolMoves Moderator
Dang Thought I had worked out the doing popup from content pane. Tried using a linked button from the symbol library, but it's not passing the mouse events to it.
-
up to my .as in code
It's a syntax issue. This popup code also does not require any code in an html page so it's handy to hold onto.
http://sandbox.blogdns.com/FUNPOPUP.swf
Leave the :VOID(0) off and watch the difference.
Code:
<A HREF="javascript:window.open('http://sandbox.blogdns.com/PD-Logo.jpg,'newWin','width=310,height=310');void(0)">Open the Popup Window</A>
Last edited by Chris_Seahorn; 12-19-2005 at 12:57 AM.
-
 Originally Posted by blanius
had to dig around in Wilburt's code to find it (wish He's comment his code  )
Okay, to be exact it's Wilbert with an 'e' and yes, I'm the w.brants on this forum who coded the content pane and yes, I didn't comment a lot .
There's no need to make it complicated. There's an event to signal scrolling that sends the position of both scrollers relative from 0 to 1. If a scroller isn't visible it returns NaN (not a number).
If you have a license agreement that scrolls vertically, you can signal the end like this
Code:
contentpane1.onScroll = function(hsPos,vsPos){
if (vsPos == 1){
// end reached
}
}
Last edited by w.brants; 12-19-2005 at 01:11 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|