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

Convert javascript button actions to Flash button actions

Status
Not open for further replies.

wudz

Programmer
Mar 28, 2001
135
GB
Could any one help in this problem, is it possible, I would like to have a flash movie with five buttons to replace the html buttons in the following script, controlling the same actions..The framed html page would consist of two frames 'b' & 't', the Flash buttons in frame 'b' the results display in frame 't' ..been playing with the FScommands, but going backwards...FAST..hi



<script language=&quot;JavaScript1.2&quot;>


// Important variables to keep track of window states.

var browser=navigator.appName;
var appWin=null;
var winOpened = false;
var canOpen=true;


// Opens the applet window
function showApplet() {

if(winOpened) {
if(appWin.closed) canOpen=true;
else canOpen=false;
}

if(canOpen) {
if(browser==&quot;Netscape&quot;) {
appWin=window.open('PApplet.jsp','newWindow2','WIDTH=468,HEIGHT=450')
}else {
appWin=window.open('PApplet.jsp','newWindow2','WIDTH=468,HEIGHT=440')
}
appWin.focus();
winOpened = true;
}
else {
if(!appWin.closed) appWin.focus();
}
}


function logout() {
if(!winOpened) {
top.location.replace(&quot;GLogout.jsp&quot;);
}
else {
if(!appWin.closed) {
appWin.close();
}
top.location.replace(&quot;GLogout.jsp&quot;);
}
}

</script>
<p>Dummy Page<br>


<a href=&quot;javascript:showApplet()&quot;>Make Call</a>&nbsp;&nbsp;&nbsp;
<a href=&quot;GDetails.jsp&quot; target=&quot;main&quot;>Change User Details</a>&nbsp;&nbsp;
<a href=&quot;RCredits&quot; target=&quot;main&quot;>Credit Details</a>&nbsp;&nbsp;
<a href=&quot;TFrame.jsp&quot; target=&quot;main&quot;>T Card</a>&nbsp;&nbsp;
<a href=&quot;javascript:logout()&quot;>Exit</a></p>




Thanks in anticipation

John
 
Small amendment frame't' rename to 'Main', helps make sense of the java script that works ok...
 
I'm no expert in java... But this seems to be a simple frameset (top & bottom or left & right), where you would have a Flash buttons movie call the appropriate content in the other frame. Why use FSCommand?
Doesn't something like this work?

on (press) {
getURL (&quot; &quot;other frame&quot;);
}

mywink.gif
ldnewbie
 
Correction: (TGML! Shesssssssssssssh!)
Code:
on (press) {
    getURL (&quot;[URL unfurl="true"]http://...TFrame.jsp&quot;,[/URL] &quot;other frame&quot;);
}


mywink.gif
ldnewbie
 
Yep, the calls for the .jsp do work ok as you pointed out.. no probs..its the 'Exit' and 'Make Call' in Flash that seem to be the problem, communicating with the javascript...mind you it was 3am this morning when testing...yawn..am I using a sledge hammer to crack a nut Oldnewbie..RCredits is a servlet & that seem ok too..just the two button actions that seem to be the prob...


John
 
John,
Do you have a link to this thing done in java? Would like to visualize what those 2 buttons (call & exit) are actually doing!
Does the call open another window? And the exit, replace it's content?
mywink.gif
ldnewbie
 
Got to get back to work! Will check in around noon (EAT)!
If you don't want to publicly post a link, send it to me at oldnewbie@hotmail.com
mywink.gif
ldnewbie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top