Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-27-2002, 07:53 PM   #1
Ema
Registered User
 
Join Date: May 2002
Posts: 16
Default Flash to Javascript

Hello,

I have a little problem. I have a button in Flash called "Save Scores" that will do two things when it is clicked: save a score into a cookie and get the updated number of scores from the cookie.

Here's the problem. If I have only the line "getURL("javascript:SaveScore( '" .....);" this works fine.

If I have only the line "getURL("javascript:GetRecordNum()");" this works fine.

But if I have both of them together in the button, like below, then it doesn't work. It doesn't save the score, and it doesn't get the number of scores.

Does anyone know what the problem is?

Thank you very much in advance.


on(release)
{

getURL("javascript:SaveScore( '" + _root.name.name + "','" + scoreCount + "', '" + timeSpent + "') ");

getURL("javascript:GetRecordNum()");

gotoAndPlay(81);

}
Ema is offline   Reply With Quote
Old 05-28-2002, 01:04 PM   #2
Jesse
ActionScript.org Founder
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: New York
Posts: 8,736
Default

Simplest solutions often being the ones that work I'm inclined to think that since you haven't terminated your JS calls with a semi-colon, that could be stuffing you up. Try:
ActionScript Code:
getURL("javascript:SaveScore( '" + _root.name.name + "','" + scoreCount + "', '" + timeSpent + "');"); getURL("javascript:GetRecordNum();");
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 05-28-2002, 03:00 PM   #3
Ema
Registered User
 
Join Date: May 2002
Posts: 16
Default

Hmmm, I tried that and it didn't work. I fooled around for a bit and found a run-about way that did make it work. I made another movie clip and called it functions. On frame one, I put the actionscript
getURL("javascript:SaveScore('" + _root.name.name + "','" + scoreCount + "', '" + timeSpent + "');");

and on frame 20, I put the actionscript

getURL("javascript:GetRecordNum();"); .

So I just call the movie clip and make it run from frame 1 to 20. And that worked! Really odd.
Ema is offline   Reply With Quote
Old 05-28-2002, 03:18 PM   #4
Jesse
ActionScript.org Founder
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: New York
Posts: 8,736
Default

Sure you're variables are all setup properly? Maybe you're passing a dummy value and causing one script to hang or something...
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 05-28-2002, 03:21 PM   #5
Ema
Registered User
 
Join Date: May 2002
Posts: 16
Default

I was playing around with the code some more and discovered something interesting. If I do only one getURL statement that calls both functions inside it, then it works! Like the following:

getURL("javascript: function1('my variables'); function2('my other variables');");

So I guess Flash doesn't like it if you call more than one getURL statements? Anyway, I really appreciate your help :-)
Ema is offline   Reply With Quote
Old 05-28-2002, 06:23 PM   #6
Abelius
Worldkit Vote Holder
 
Abelius's Avatar
 
Join Date: May 2002
Location: Miami - USA
Posts: 816
Send a message via Yahoo to Abelius
Default

This was a real nice thread to read...
Informative.
__________________
Cordially,
Abelius
Commuting between Birmingham, AL, Miami, FL and Beijing, China
http://www.worldkit.com
Abelius is offline   Reply With Quote
Old 05-28-2002, 11:21 PM   #7
Jesse
ActionScript.org Founder
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: New York
Posts: 8,736
Default

Hrmm I should have thought to suggest just one line. Getting slow in my old age
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
one template, many looks? subquark ActionScript 1.0 (and below) 1166 10-29-2013 06:18 PM
Developing a flash site, Part1: Some thoughts Bloom22 Other Flash General Questions 6 09-29-2006 02:10 AM
HELP! Flash in iframe to call Javascript in parent lordcatalien ActionScript 1.0 (and below) 15 09-19-2004 11:01 AM
[Q] Do we need those forums??? CyanBlue General Chat 59 07-27-2004 11:13 AM
HELP! Flash in iframe to call Javascript in parent lordcatalien Server-Side Scripting 2 01-06-2003 05:44 PM


All times are GMT. The time now is 11:34 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.