Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Extensions and Plugins > JSFL - Extending Flash

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-24-2005, 12:47 AM   #1
ubergrafik
milky...
 
ubergrafik's Avatar
 
Join Date: Jan 2005
Posts: 370
Send a message via MSN to ubergrafik
Default extracting library info

is there anyway of creating a list of all the things in the library, what their linkage is and other details like that? I tried the generate size report, but it only lists Symbol, Shape Bytes, Text Bytes, ActionScript Bytes.
ubergrafik is offline   Reply With Quote
Old 03-24-2005, 01:04 AM   #2
deadbeat
Registered User
 
Join Date: Feb 2001
Location: vancouver
Posts: 2,219
Default

You could do it with JSFL, but not Actionscript...

K.
deadbeat is offline   Reply With Quote
Old 03-24-2005, 01:08 AM   #3
ubergrafik
milky...
 
ubergrafik's Avatar
 
Join Date: Jan 2005
Posts: 370
Send a message via MSN to ubergrafik
Default

Thought so, Don't know of anything do you? Or can point me in the right direction?
ubergrafik is offline   Reply With Quote
Old 03-24-2005, 01:12 AM   #4
deadbeat
Registered User
 
Join Date: Feb 2001
Location: vancouver
Posts: 2,219
Default

In terms of a JSFL script? Something like this maybe:
ActionScript Code:
var libItems=fl.getDocumentDOM().library.items; for(var i in libItems){ fl.trace(libItems[i].name); fl.trace(libItems[i].itemType); fl.trace(libItems[i].linkageIdentifier); // etc... }

Check out the JSFL dictionary for more details on the available properties - you'll mainly need to look at the Library and Item classes...

http://www.macromedia.com/livedocs/f...45.html#120689

HTH,

K.
deadbeat is offline   Reply With Quote
Old 03-24-2005, 02:04 AM   #5
ubergrafik
milky...
 
ubergrafik's Avatar
 
Join Date: Jan 2005
Posts: 370
Send a message via MSN to ubergrafik
Default

Thanks, this is very useful.
ubergrafik is offline   Reply With Quote
Old 03-24-2005, 02:18 AM   #6
ubergrafik
milky...
 
ubergrafik's Avatar
 
Join Date: Jan 2005
Posts: 370
Send a message via MSN to ubergrafik
Default

OK, i pasted your code in (which i'm not sure you intended) and it didn't display anything. Was that the wrong thing to do?
I looked through the documentation and couldn't find any reference to libItems.name, libItems.itemType or libItems.linkageIdentifier

Last edited by ubergrafik; 03-24-2005 at 02:24 AM..
ubergrafik is offline   Reply With Quote
Old 03-24-2005, 07:24 PM   #7
deadbeat
Registered User
 
Join Date: Feb 2001
Location: vancouver
Posts: 2,219
Default

That is not actionscript, as mentioned it is JSFL...

You need to create a new Flash Javascript file, paste in that code, and save it. Then run the script from the Commands/Run Command menu...

K.
deadbeat is offline   Reply With Quote
Old 03-25-2005, 03:21 AM   #8
ubergrafik
milky...
 
ubergrafik's Avatar
 
Join Date: Jan 2005
Posts: 370
Send a message via MSN to ubergrafik
Default

Cool. Working. I'll tweak it and let you know how i go. Thanks!
ubergrafik is offline   Reply With Quote
Old 03-25-2005, 03:32 AM   #9
MichaelxxOA
Flash Sucks
 
MichaelxxOA's Avatar
 
Join Date: Mar 2005
Location: Victorville, Ca
Posts: 2,224
Send a message via AIM to MichaelxxOA Send a message via MSN to MichaelxxOA Send a message via Yahoo to MichaelxxOA Send a message via Skype™ to MichaelxxOA
Default

why do you need this? if you don't mind me asking.
-Michael
MichaelxxOA is offline   Reply With Quote
Old 03-30-2005, 04:48 AM   #10
ubergrafik
milky...
 
ubergrafik's Avatar
 
Join Date: Jan 2005
Posts: 370
Send a message via MSN to ubergrafik
Default

I have a large library and wanted to get all the settings recorded somewhere, so it can be referred to at a later stage.

FYI, this is saved out as a jsfl file and put into the commands folder and run from inside flash. I'll post up the final version with instructions when it is going...

OK, I'd still like to do a few things tho. So far, I have all the info that i need, printing out line by line in the output window. Code as follows:

ActionScript Code:
var libItems=fl.getDocumentDOM().library.items; var itemNum = 1 fl.trace("NAME    TYPE    LINKAGE    AS2.0    URL");    for(var i in libItems){         fl.trace("Num" + ++itemNum +", "+         "NAME: "+libItems[i].name+", "+         "TYPE: "+libItems[i].itemType+", "+         "LINKAGE: "+libItems[i].linkageIdentifier+", "+         "AS2.0 CLASS: "+libItems[i].linkageClassName+", "+         "URL: "+libItems[i].linkageURL         )}

OK. So here's how it outputs:

Quote:
Num70, NAME: Skin/ButtonStates/BtnLearnStates/BtnLearnUp, TYPE: movie clip, LINKAGE: BtnLearnUp, AS2.0 CLASS: , URL: Skin.swf
Num71, NAME: Skin/ButtonStates/BtnLearnStates/BtnLearnOver, TYPE: movie clip, LINKAGE: BtnLearnOver, AS2.0 CLASS: , URL: Skin.swf
Num72, NAME: Skin/ButtonStates/BtnLearnStates/BtnLearnDown, TYPE: movie clip, LINKAGE: BtnLearnDown, AS2.0 CLASS: , URL: Skin.swf
URGH!!! How can i format the output so that it looks nice. Like when you generate size report:

Quote:
Symbol Shape Bytes Text Bytes ActionScript Bytes
------------------------- ----------- ---------- ------------------
Interface 0 0 37
Frame 1485 0 0
ContentMask 305 0 0
MultiCheckBox 79 0 0
RadioCheckBox 164 0 0
(unfortunatley it looks like the white space was all stripped out, but hopefully you know what i mean.)

Cheers!!
ubergrafik 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 12:11 PM.


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