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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vbscript/java links into Flash actions?

Status
Not open for further replies.

Alysen

Technical User
Jun 15, 2000
2
0
0
US
I am trying to implement Flash navigation into a VBScript/Javascript coded page. I have the Flash successfully embedded, but I can't/don't know how to script the link actions into Flash so that they work as they do in the original VBScript (see below for original code). I am very unfamiliar with VB/Javascript. Is this even possible to do in Flash (mixing the two scripting languages?)

Any help would be greatly appreciated!

Thanks!
Alysen

_______________________________
What the link looks like in the current script:

<a style=&quot;cursor:hand;&quot; href=&quot;javascript:<%=Namespace(&quot;showContent&quot;)%>('home');&quot;><img name=&quot;<%=Namespace(&quot;TabIMG0&quot;)%>&quot; align=&quot;left&quot; hspace=&quot;0&quot; border=&quot;0&quot; src=&quot;<%=imagePaths(0)%>&quot; alt=&quot;<%=Replace(tooltipHome, &quot;&quot;&quot;&quot;, &quot;&quot;&quot;)%>&quot;></a>
_______________________________
Below is my unsuccessful attempt to get this link functioning on the Flash button as it does above. I put this code as an action on the button:

on (release) {
getURL (&quot;<%=Namespace(\&quot;showContent\&quot;)%>('home')&quot;);
}
 
You can not mix the scripts like that. Are you writing this scripts yourself? I am assuming that is ASP, I need to know if Namespace(&quot;showContent&quot;) is calling a variable (ShowContent) from the recordset Namespace, meaning that it is linked to a database. Anyway, instead of doing the getURL like you did, use the FSCommand to call a Javascript.
The vbscript is a server side scripting language, so by the time you use the fscommand, the page will already be loaded. You need to reload the page through the Javascript that you call with the Fscommand and then send the variables needed to reenter the value of Namespace(&quot;showContent&quot;).
Please send more information and maybe a link.


Fernando Regueiro
ferhelping@yahoo.com

 
Fernando (or anyone else that can help),

Thanks for your response to my inquiry titled &quot;vbscript/java links into Flash actions?&quot; at
!



Below is some additional information. Any help would be greatly appreciated! As I understand, the function name is <%=Namespace(&quot;showContent&quot;)%>(content). The <%=Namespace(&quot;showContent&quot;)%> is asp code. This value is assigned in an ASP page. Let me know if we need to decipher where this value comes from...

Below is a more recent post with additional info about my problem. I really appreciate any advice/help you could give! Thanks!

Alysen

________________

Dynamic links in Flash using existing code

To All:

I have run into difficulties trying to incoporporate exisiting navigation into Flash. Any help/advice would be greately appreciated!

I am trying to implement a Flash navigation in place of a sites current navigation. The current links in the html are dynamically created using Javascript and ASP. The link code appears as below:

<a href=&quot;javascript:<%=Namespace(&quot;showContent&quot;)%>('home');&quot;>HOME</a>

I need to use a similar structure as above for Flash in order to create the links dynamically within Flash, but have been unsuccessful simply adding the above code in a manner such as:

getURL (&quot;javascript:<%=Namespace(&quot;showContent&quot;)%>('home')()&quot;);

I do have the javascript function within the html page that the Flash file is embedded on as well as the ASP function. The Javascript code for the function is as follows:

<script language=&quot;JavaScript&quot;>

doContentSwitch = true;

function <%=Namespace(&quot;showContent&quot;)%>(content) {

if (content != &quot;&quot;) {

doContentSwitch = true;

isLink = false;

isLink = (isLink || (content.indexOf(' > -1));

isLink = (isLink || (content.indexOf('file://') > -1));

isLink = (isLink || (content.indexOf('ftp://') > -1));

if (isLink) {

document.location = &quot;<%=hostPath%>?page=header&headerTabName=url&headerContentURL=&quot; + escape(content);

}

else {

document.location = &quot;<%=hostPath%>?page=header&headerTabName=&quot; + content;

}

}

}

<%

Select Case (selectedTabName)

Case &quot;&quot;, &quot;none&quot;:

contentURL = &quot;&quot;

Case &quot;url&quot;

contentURL = Trim(Request(&quot;querystring:headerContentURL&quot;))

Case Else

contentURL = hostPath & &quot;?page=&quot; & selectedTabName

End Select

If (contentURL <> &quot;&quot;) Then

%>

parent.frames.<%=contentFrame%>.location.replace(&quot;<%=contentURL%>&quot;);

<%

End If

%>

</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top