<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>mandarin.no &#187; cs3</title>
	<atom:link href="http://mandarin.no/tag/cs3/feed/" rel="self" type="application/rss+xml" />
	<link>http://mandarin.no</link>
	<description></description>
	<lastBuildDate>Tue, 17 Aug 2010 09:35:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Flash CS3: Adding custom classes to MovieClips in the library</title>
		<link>http://mandarin.no/flash/flash-cs3-adding-custom-classes-to-movieclips-in-the-library/</link>
		<comments>http://mandarin.no/flash/flash-cs3-adding-custom-classes-to-movieclips-in-the-library/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 20:19:55 +0000</pubDate>
		<dc:creator>Thomas Viktil</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[asset]]></category>
		<category><![CDATA[asset management]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[cs3]]></category>
		<category><![CDATA[custom class]]></category>
		<category><![CDATA[document class]]></category>
		<category><![CDATA[extending]]></category>
		<category><![CDATA[external assets]]></category>
		<category><![CDATA[external library]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[linkage]]></category>
		<category><![CDATA[movieclip]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[resources]]></category>
		<guid isPermaLink="false">http://mandarin.no/?p=29</guid>
		<description><![CDATA[Today I was tearing out my hair in frustration of a problem I just couldn&#8217;t seem to figure out. And the solution was just about as stupid as I had hoped it wouldn&#8217;t be. The case was as followed: I&#8217;m putting MovieClips in a SWF for use as a library in another SWF (I&#8217;ll call [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was tearing out my hair in frustration of a problem I just couldn&#8217;t seem to figure out. And the solution was just about as stupid as I had hoped it wouldn&#8217;t be.</p>
<p>The case was as followed: I&#8217;m putting MovieClips in a SWF for use as a library in another SWF (I&#8217;ll call it master SWF). The library SWF has a custom document root with a function that helps me return the MovieClips I need. Some of the MovieClips in the library are extended with custom classes.</p>
<p>When I tried to return a MovieClip from the library SWF I would get an error message saying the MovieClip doesn&#8217;t exist. Even if the class has been set up correctly, the package names are fine, and everything looks right.</p>
<p>The library SWF resides in the root, together with the master SWF. This way I can keep the same document root in both SWF&#8217;s and share classes between. The custom class for the MovieClip I tried to return is in package bb.page, and the name of the class is Frontpage.</p>
<p>In Flash I set the linkage to bb.page.Frontpage, compiled, and expected a positive result. But no. I tried moving everything down to root level, thus flattening the whole directory structure. Removed the package name from the Frontpage class and gave it a try. It actually worked. But it&#8217;s not an optimal solution because I don&#8217;t want to mess up the root directory with tons of files.</p>
<p>Moving everything back in to the directories they came from, I gave a stupid idea a try; renaming the MovieClip in the library. And guess what? Renaming the MovieClip from &#8216;Frontpage&#8217; to &#8216;bb.page.Frontpage&#8217; did the trick. I haven&#8217;t bothered trying to figure out why it&#8217;s like this, but it seems like it just is.</p>
<p>So, conclusion to this;</p>
<blockquote><p><span style="text-decoration: line-through;">Make sure the name of the MovieClip is the same as the linkage class.</span></p></blockquote>
<p><span style="text-decoration: line-through;">Example: class Frontpage resides in bb.page. Linkage class is therefore &#8216;bb.page.Frontpage&#8217;. This will also have to be the name of the MovieClip.</span></p>
<p><strong><span style="color: #ff0000;">UPDATE August 12 2008<br />
</span></strong></p>
<p>While at work today I spent a few hours figuring out how to deal with this problem and came to a new conclusion; what I&#8217;ve written in this article is wrong. I haven&#8217;t managed to come to a perfect solution, but good enough for the project I&#8217;m working on. I&#8217;ll be back later to write more about this.</p>
<p>In the mean time, and if you are looking for a solution to a similar problem, try searching for keywords like as3 asset managemt, resource management, external libraries and such. I found some articles that gave me a better understanding of what I&#8217;m dealing with.</p>
]]></content:encoded>
			<wfw:commentRss>http://mandarin.no/flash/flash-cs3-adding-custom-classes-to-movieclips-in-the-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
