Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-01-2005, 09:20 AM   #1
surfinglilbro
I work for Ernie and Bert
 
surfinglilbro's Avatar
 
Join Date: Oct 2005
Location: Malaysia
Posts: 4
Send a message via MSN to surfinglilbro
Unhappy Passing Javascript strings into Flash movie

I'm generally trying to make a blog. So I've tried declaring string variables in between the <heads> section like this:

HTML Code:
<script type="text/javasrcipt">var blogcontent = "something something."</script>
So I'm trying to get it to be dispalyed in my flash movie like so:

ActionScript Code:
_root.somewhere.htmlText = blogcontent;

Now the problem is I don't know how to tell the flash movie to reach out and get the the javascript variable and display it. I've tried the
ActionScript Code:
getURL; getProperty
commands, but it don't work. The only progress I've made after spending hours staring at tutorials and forums is that I've to set the swLiveContent to equal true to allow the flash to communicate with javascript.

Please help!!
surfinglilbro is offline   Reply With Quote
Old 10-02-2005, 01:47 AM   #2
oldnewbie
Banned by AS.org Staff
 
Join Date: Mar 2002
Posts: 10,533
Default

SetVariable...

http://www.macromedia.com/support/fl...hflash_03.html
oldnewbie is offline   Reply With Quote
Old 10-03-2005, 10:46 AM   #3
surfinglilbro
I work for Ernie and Bert
 
surfinglilbro's Avatar
 
Join Date: Oct 2005
Location: Malaysia
Posts: 4
Send a message via MSN to surfinglilbro
Red face Arrrggghhhh!!!

Thanks "oldnewbie"...hmm...paradox. I read up the article and tried to apply it. But I still doesn't work. In the flash I did something like this:
ActionScript Code:
var BLOG; myLeftMargin = 10; _root.bg.createTextField("theText", 1, 10, 10, _root.bg._width-(2*myLeftMargin), 100); _root.bg.theText.wordWrap = true; _root.bg.theText.html = true; _root.bg.theText.htmlText = BLOG;
And in the webpage something like this:
HTML Code:
<script language="JavaScript">
var movie = window.document.movie;
movie.SetVariable("BLOG", "If this shows. Then it works.");
</script>
Am I doing something wrong here? I seem to be missing the beef patty in the beef burger I'm trying make!! ARRGGHHH!!!
surfinglilbro is offline   Reply With Quote
Old 10-03-2005, 02:32 PM   #4
oldnewbie
Banned by AS.org Staff
 
Join Date: Mar 2002
Posts: 10,533
Default

A little more complex than just that...

You should attach your testing .fla (along with your .html) zipped up and in a MX only format (or lower), not MX2004, and I'll set it up for you...
oldnewbie is offline   Reply With Quote
Old 10-04-2005, 10:17 AM   #5
surfinglilbro
I work for Ernie and Bert
 
surfinglilbro's Avatar
 
Join Date: Oct 2005
Location: Malaysia
Posts: 4
Send a message via MSN to surfinglilbro
Exclamation Ernie and Bert say:

"Ooo!!! Thanks!!"
Here's the file, thanks!! Really appreciate this!!
Attached Files
File Type: zip testing.zip (46.9 KB, 107 views)
surfinglilbro is offline   Reply With Quote
Old 10-04-2005, 04:21 PM   #6
oldnewbie
Banned by AS.org Staff
 
Join Date: Mar 2002
Posts: 10,533
Default

Here ya go!

I've move your movie elements to frame 2, and added a stop(); action, because there's a delay between creating a dynamic textfield and assigning some text to it.

I've also corrected your .html and commented it...

That said, you could possibly achieve the same results with appending a simple query string variable or using FlashVars...

http://www.macromedia.com/cfusion/kn...53#querystring

http://www.macromedia.com/cfusion/kn...fm?id=tn_16417
Attached Files
File Type: zip mytesting.zip (44.7 KB, 109 views)
oldnewbie is offline   Reply With Quote
Old 10-06-2005, 05:38 AM   #7
surfinglilbro
I work for Ernie and Bert
 
surfinglilbro's Avatar
 
Join Date: Oct 2005
Location: Malaysia
Posts: 4
Send a message via MSN to surfinglilbro
Exclamation nice.

but it still doesn't work...kinda starting to understand...I published the flash file and opened the html file...but no text appeared in the text field!! I've checked the URL and I don't think there's anything wrong...btw...I tested it on both Mozilla Firefox and Internet Explorer 6 and still doesn't work.

And why is it you put in
HTML Code:
<!-- Hide JavaScript from old browsers//  // done hiding -->
Why do you want to hide it?
surfinglilbro 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


All times are GMT. The time now is 11:06 AM.

///
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.