Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Reply
 
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Old 06-15-2007, 03:04 PM   #1
Birdsong
Registered User
 
Join Date: Jun 2003
Location: NYC
Posts: 182
Default Embed swf assets in Flash 9 AS3 - not flex not flashdevelop

(About the title: searching for pure AS3 Flash 9 info is so incredibly difficult because everything on the web seems to be polluted with fl_ex and other 3rd party compilers like flash_dev_elop references - hope this thread will be of some use to others like me looking for pure Flash 9 AS3 info.)

Hi, due to the issue summarized above I can not find any clear information about how or if I can embed swf files will library assets in my Flash 9 AS3 code. I think all the references I have seen to [Embed...] are likely fl_ex references. Because when I try using it in Flash 9 AS3 the compiler errors out.

So is it possible to embed swf files with library assets - like for use in theming? If so, how? If not, what is recommended for managing libraries of graphics and fonts etc?

Note I want to compile them in, not load them at run time.

Thanks a lot in advance!
Birdsong is offline   Reply With Quote
Old 06-15-2007, 04:01 PM   #2
plutocrat
AVM2 has mood swings. :(
 
Join Date: May 2007
Posts: 226
Default

I am having trouble understanding what it is you want; Library items are automatically embedded at compile-time (that is what the Library is for...).

To add library items at run-time, simply use:

ActionScript Code:
new LibraryItem()

where LibraryItem is the class in the Library.

Perhaps an example might help?
plutocrat is offline   Reply With Quote
Old 06-15-2007, 04:11 PM   #3
Birdsong
Registered User
 
Join Date: Jun 2003
Location: NYC
Posts: 182
Default

thanks for the reply.

generally it would be convenient to compile in assets from other swfs, rather than have to always put everything into the library of my main fla. ha_xe and flash_dev_elop and it appears flex supports compiling in assets from other swfs.

I believe this is the syntax for fl_ex
ActionScript Code:
[Embed(source="library.swf", symbol="linkageID")] private var SomeClass:Class;

ha_xe uses
Code:
-swf-version 9
-swf-lib lib.swf
Birdsong is offline   Reply With Quote
Old 06-15-2007, 05:01 PM   #4
dr_zeus
Feathers
 
dr_zeus's Avatar
 
Join Date: Mar 2005
Location: Silicon Valley
Posts: 1,999
Default

Only the Flex SDK supports [Embed] metadata.

In Flash CS3, you can import complete SWF files into the library, but I'm pretty certain that you cannot import a specific symbol from a SWF. You will need to copy the symbol from the original FLA file or export your symbols into individual SWFs.
__________________
Josh Tynjala | Feathers
dr_zeus is offline   Reply With Quote
Old 06-15-2007, 05:12 PM   #5
Birdsong
Registered User
 
Join Date: Jun 2003
Location: NYC
Posts: 182
Default

hmm - ok - well that is managable for my current project - thanks for the reply!

But that pretty much means Adobe took a powder on extending OOP concepts to graphics in Flash 9. Nice. Also great that AS3 features are different in Flash than in fl_ex.
Birdsong is offline   Reply With Quote
Old 06-16-2007, 02:12 AM   #6
plutocrat
AVM2 has mood swings. :(
 
Join Date: May 2007
Posts: 226
Default

You could hack together a solution along the lines of:

1. A library swf, document class:

ActionScript Code:
package com.lib {      import com.lib.symbols.*      public class myLibrary {           public static const symbolReference:whateverSymbol           //etc      } }

2. Then in your main swf load that swf and instatiate the symbols from it.

It seems unnecessary, but might come in handy if one were to attempt to use some form of dynamic library.

Although I have no experience with Flex itself, I imagine that it might be more relevant to you in this case .
plutocrat is offline   Reply With Quote
Old 06-18-2007, 05:09 PM   #7
dr_zeus
Feathers
 
dr_zeus's Avatar
 
Join Date: Mar 2005
Location: Silicon Valley
Posts: 1,999
Default

[Embed] is not an AS3 language feature. It's a compiler specific "metadata" feature in the Flex SDK.

I'm curious, Birdsong, why do you keep inserting underscores _ when you type Flex, HaXe, or FlashDevelop?
__________________
Josh Tynjala | Feathers
dr_zeus is offline   Reply With Quote
Old 06-18-2007, 05:20 PM   #8
Birdsong
Registered User
 
Join Date: Jun 2003
Location: NYC
Posts: 182
Default

because it is so frustrating trying to find info on AS3 that's not cluttered with Flex info on the web. Most of my searched for AS3 info return code thats got flex only stuff in it or is written in that xml like markup. So to find pure info about AS3 that I typically do a search like: AS3 whatever -Flex

Thus if flex is mentioned in the page then that might not show up in search results later so I was trying to keep flex and other things not related to AS3 and Flash 9 completely out of the thread. Ah well - it was worth a shot.
Birdsong is offline   Reply With Quote
Old 06-18-2007, 05:24 PM   #9
sasxa
Member
 
Join Date: May 2005
Posts: 70
Send a message via ICQ to sasxa
Default

Quote:
Originally Posted by Birdsong View Post
But that pretty much means Adobe took a powder on extending OOP concepts to graphics in Flash 9.
they did more than that: whole Illustrator CS3, for example, is built on OOP concepts. They took whole display-list-structure and implemented it in Illustrator. Now you can access all objects and objects' properties individualy, change anything you like. apply filters/effects to any part of your design... Buying Macromedia was great move for Adobe...
sasxa is offline   Reply With Quote
Old 07-13-2007, 06:38 PM   #10
harborbay
Registered User
 
Join Date: Jul 2007
Posts: 2
Default

Hi Birdsong,

I think you'll find the answer you want here:

http://www.bit-101.com/blog/?p=853

David
harborbay 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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash content in Flex? Reinholdt ActionScript 3.0 4 05-10-2007 02:44 PM
Flex 2 page and Flash Player 9 upgrade surfer13 Flex 2, 3 & 4 7 09-20-2006 10:27 AM
Streaming Flash Player 6 simail Other Flash General Questions 7 04-03-2002 11:14 AM
Flash MX seminar Tink ActionScript 1.0 (and below) 5 03-17-2002 04:41 AM
Php, Javascript, and Flash 5 browser detect and more! Redline01 Server-Side Scripting 2 08-11-2001 01:09 AM


All times are GMT. The time now is 07:37 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.