Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-26-2004, 04:02 PM   #1
marcelfahle
Registered User
 
marcelfahle's Avatar
 
Join Date: Jul 2004
Location: Bochum, Germany
Posts: 4
Send a message via ICQ to marcelfahle
Default MMExecute return value ?

Hey guys,

could anybody out there explain, why the output below is "String"?
Should be Object...

PHP Code:
var libraryItems:Array = MMExecute("fl.getDocumentDOM().library.items;");
output.text "type: " typeof libraryItems
Thanks a lot!

Marcel
marcelfahle is offline   Reply With Quote
Old 07-27-2004, 10:26 AM   #2
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,858
Default

MMExecute always returns a string. if you want to manipulate the objects call functions in a jsfl file (i presume u r floking around with a windowSWF), u can call a jsfl like this
ActionScript Code:
return MMExecute("fl.runScript(fl.configURI+\"WindowSWF/"+ filename + "\", \""+scriptName+"\");");

any arguments will be passed as parameters delimated by commas after the scriptname tag.
also:
in the jsfl function you can ofcourse go like this
Code:
var arr = fl.getDocumentDOM().library.items;
//where arr is an array then
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 07-28-2004, 09:57 AM   #3
marcelfahle
Registered User
 
marcelfahle's Avatar
 
Join Date: Jul 2004
Location: Bochum, Germany
Posts: 4
Send a message via ICQ to marcelfahle
Default

Hi hangalot,

thanks for your help. That was, what I tried before. My code was just a shortcut. Here is my full code.

JSFL File:
Code:
function getLibrary() {
	return fl.getDocumentDOM().library.items;
}
WindowSWF Actionscript:
Code:
var libraryItems = MMExecute("fl.runScript('"+jsflFile+"', 'getLibrary');");
output.text = "lšnge: " + libraryItems.length + newline;
output.text += "type: " + typeof libraryItems + newline;
output.text += "content: " + libraryItems + newline;
I'm still getting a String Output:
Screenshot

Do you know what's wrong in my Script?
marcelfahle is offline   Reply With Quote
Old 07-28-2004, 10:16 AM   #4
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,858
Default

as i said, with MMexecute you will always get a string as a return. the array object is only availible in the jsfl itself. you will have to parse that string in order to represent it in the windowSWF level.
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 07-28-2004, 10:38 AM   #5
marcelfahle
Registered User
 
marcelfahle's Avatar
 
Join Date: Jul 2004
Location: Bochum, Germany
Posts: 4
Send a message via ICQ to marcelfahle
Default

Damn! Now I understand
Thanks a lot!!
marcelfahle 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 09:16 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.