SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    Pragmatic Programmer halfasleeps's Avatar
    Join Date
    Feb 2006
    Location
    Altoona, PA. USA
    Posts
    1,945
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    vbscript location.href problems

    first of all this is an IE only problem

    i have this function that i call from flash to change the location.href so as you navigate the flash file its as if you are changing pages even tho you arent so if you refresh or add to favorites it remebers what part of the flash page you were at instead of taking you back to the beginning

    it looks like this:
    Code:
    <script language="VBScript">
    <!-- 
    Sub flashapp_FSCommand(ByVal command, ByVal args)
    	//window.alert args
    	select case command
    		case "putHREF"  location.href = args 
    		window.alert args 
    		window.alert location.href
    		case "putTitle" document.title = args
    		case "putBgColor" document.bgColor = args
    		case "putColor1" document.cookie = "ADColor1="+args+expires
    		case "putColor2" document.cookie = "ADColor2="+args+expires
    	end select
    end sub
    -->
    </script>
    and i call it from flash like this:
    Code:
    if (this.isMSIE)
    			{
    				// Internet Explorer is more reliable with FSCommand from the ActiveX control to VBScript
    				fscommand("putHREF", "#"+this.stateStr);
    			}
    but i also have another function which is just javascript i call from flash to do a window.open() to open a portfolio peice in a new window
    i call it from flash like this:
    Code:
    getURL("javascript:var myWin2; if(!myWin2 || myWin2.closed){myWin2 = window.open('"+url+"', 'window2', '"+"width="+w+", height="+h+", toolbar=false, location=false, directories=false, status=false, menubar=false, scrollbars=false, resizable=false, top='+((screen.height/2)-("+h/2+"))+', left='+((screen.width/2)-("+w/2+"))+'"+"')} else{myWin2.focus();};void(0);");

    but after i open something in a new window like that the vb function stops working... i am alerting the location.href and its saying that its changed but the url in the address bar no longer changes its also making it so that when i click to open a second portfolio piece it messes up.

    Does anyone have a clue what i need to do??? i've been trying since last night with no luck.

    A might big thanks to anyone who can help
    Last edited by halfasleeps; Aug 26, 2006 at 13:48.
    Altoona Design
    Freelance Flex developer for hire.
    ActionScript Programmer with 8 Years Experience.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •