Posted by gerrydesign in SWF Studio V3 on Mar 07 2011, 01:59 pm

Hi,

I was trying to open an HTML file and passing parameters (might be flashvars ) to it for the SWF in the HTML file. It works (opens the browser and shows the SWF file) before I build the EXE file in SWF Studio but after building in SS, it does not work anymore :(

I'm just using plain old: navigateToURL(request, '_blank');

The link looks like this:
content/visualTeachingPackage/Games/index.html?swfFile=DoublePursuit/doublepursuit.swf&w=661&h=450&dataFile=DoublePursuit/MW_L4_WG_U2_Jeopardy.txt&imagesLoc=DoublePursuit/images/

I wonder if it's just an character escape issue.

TIA for the response.

Gerry


Posted by northcode in SWF Studio V3 on Mar 07 2011, 02:07 pm

Instead of your URL style relative path, try using an absolute file:// URL. You can construct it like this (below). The ssGlobals.ssStartDir will be translated to the folder where your EXE is, so it will have the same effect as using a relative path.

url = "file://"+ssGlobals.ssStartDir+"\\content\\visualTeachingPackage\\Games\\index.htm&w=661&h=450&dataFile=DoublePursuit/MW_L4_WG_U2_Jeopardy.txt&imagesLoc=DoublePursuit/images/"

I'm not sure if you'll have to convert the path you're passing as a parameter to an absolute file:// URL as well, but that should at least get your page to load.


Posted by gerrydesign in SWF Studio V3 on Mar 07 2011, 02:25 pm

Thanks Tim! I wil give this a try.Should I use ssCore.Shell.open for this as well?
i.e.:

ssCore.Shell.open( { path:"file://"+ssGlobals.ssStartDir+"\\content\\visualTeachingPackage\\Games\\index.htm&w=661&h=450&dataFile=DoublePursuit/MW_L4_WG_U2_Jeopardy.txt&imagesLoc=DoublePursuit/images/"} );


Posted by northcode in SWF Studio V3 on Mar 07 2011, 03:23 pm

Shell.open will open the HTML file corectly but I'm not 100% sure it will pass the query string since the query string is normally handled by the server and passed to the page after the resource (page, SWF, etc) has been identified and loaded.


Posted by gerrydesign in SWF Studio V3 on Mar 08 2011, 10:40 am

The query strings on the link did not work so I had to hard code the vars in the HTML. The client was ok with that but for future reference, I wonder if there is a better approach than hard coding vars or editing HTML files. The intent of the project is to put the EXE in a removable media and access different file type via XML. Again thanks for the awesome product. I still need to explore the more advance feature of SS


Posted by northcode in SWF Studio V3 on Mar 08 2011, 02:13 pm

I'd need to know more about exactly what you're trying to accomplish to give you a better answer, but you can always generate the HTML on-the-fly (in the temp folder) and then use Shell.open to open the HTML file from the temp folder. That means you'd have to use absolute paths in the HTML files, but since you're creating them on-the-fly that shouldn't be any trouble.