A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 27

Thread: Pop-up from a Contentpane?

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702

    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>
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    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)

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    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.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  4. #4
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    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.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  5. #5
    Can't Re- Member gusmus's Avatar
    Join Date
    Sep 2002
    Location
    España
    Posts
    663
    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

  6. #6
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Did some testing on my own. Looks like a no go.

  7. #7
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    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.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  8. #8
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    I'm sure that can be done.

  9. #9
    Can't Re- Member gusmus's Avatar
    Join Date
    Sep 2002
    Location
    España
    Posts
    663
    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="javascriptopup()">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

  10. #10
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Quote 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?
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  11. #11
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    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.

  12. #12
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Quote 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?
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  13. #13
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Wilburt is the Brants on the forum he wrote the code for the content pane.

    But those work I just tested it.

  14. #14

  15. #15
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    (post erased by dniezby)
    Last edited by dniezby; 12-18-2005 at 11:23 PM. Reason: You already answered this one
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  16. #16
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    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?
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  17. #17
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    I do that for code I want to execute all the time.. Just one way to do it.

  18. #18
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    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.

  19. #19
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    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>

  20. #20
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Quote 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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center