<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Instantiating ActionScript 3.0 classes at runtime, and a Flex compiler trick</title>
	<atom:link href="http://flexonrails.net/?feed=rss2&#038;p=65" rel="self" type="application/rss+xml" />
	<link>http://flexonrails.net/?p=65</link>
	<description>-</description>
	<lastBuildDate>Tue, 22 Dec 2009 16:08:15 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Agilan palani</title>
		<link>http://flexonrails.net/?p=65&#038;cpage=1#comment-20382</link>
		<dc:creator>Agilan palani</dc:creator>
		<pubDate>Wed, 30 May 2007 03:49:43 +0000</pubDate>
		<guid isPermaLink="false">http://flexonrails.net/?p=65#comment-20382</guid>
		<description>Hi Matjaz,
  I tried the code which you gave. But it doesn&#039;t help. It always gives IllegalOperationError. Iam struck up here. Will you provide the code which works for you? 

Thanks
Agilan Palani</description>
		<content:encoded><![CDATA[<p>Hi Matjaz,<br />
  I tried the code which you gave. But it doesn&#8217;t help. It always gives IllegalOperationError. Iam struck up here. Will you provide the code which works for you? </p>
<p>Thanks<br />
Agilan Palani</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Karpinski</title>
		<link>http://flexonrails.net/?p=65&#038;cpage=1#comment-8879</link>
		<dc:creator>Richard Karpinski</dc:creator>
		<pubDate>Fri, 23 Mar 2007 21:47:47 +0000</pubDate>
		<guid isPermaLink="false">http://flexonrails.net/?p=65#comment-8879</guid>
		<description>I have a wild idea of making the mouse do lots more. I want an entire zoom world to be accessible by just mousing. Rollover into a contained zone written smaller auto-zooms into it exactly to where the text is the natural size that the viewer prefers. Recursively.

I&#039;m thinking that if the contents of the zoom world are just text and images and maybe a video or two, then this is an almost trivial application of FlexibleRails. I expect to pay for an answer, and more for more detail about how and why.

Having the content in a database would seem to permit arbitrary rearrangement on the fly without changing the application a whit and thus needing no new compile. Each region has a natural screen size and contains deeper regions without limit. Zooming in and out is automatic. Just mousing does all navigation needed to see the whole site. Then we can perhaps add command gestures, and still no buttons or keys until you are filling in some form. Still nearly trivial to implement in FlexibleRails.

Is it possible that that is true? Or nearly true?
Can I pay someone to answer questions like this?


Richard Karpinski, World Class Nitpicker
148 Sequoia Circle, Santa Rosa, CA 95401
dick@cfcl.com  Home +1 707-546-6760   Cell +1 707-228-9716

ps Put (or leave) &quot;nitpicker&quot; in the subject line to get past my spam filters.</description>
		<content:encoded><![CDATA[<p>I have a wild idea of making the mouse do lots more. I want an entire zoom world to be accessible by just mousing. Rollover into a contained zone written smaller auto-zooms into it exactly to where the text is the natural size that the viewer prefers. Recursively.</p>
<p>I&#8217;m thinking that if the contents of the zoom world are just text and images and maybe a video or two, then this is an almost trivial application of FlexibleRails. I expect to pay for an answer, and more for more detail about how and why.</p>
<p>Having the content in a database would seem to permit arbitrary rearrangement on the fly without changing the application a whit and thus needing no new compile. Each region has a natural screen size and contains deeper regions without limit. Zooming in and out is automatic. Just mousing does all navigation needed to see the whole site. Then we can perhaps add command gestures, and still no buttons or keys until you are filling in some form. Still nearly trivial to implement in FlexibleRails.</p>
<p>Is it possible that that is true? Or nearly true?<br />
Can I pay someone to answer questions like this?</p>
<p>Richard Karpinski, World Class Nitpicker<br />
148 Sequoia Circle, Santa Rosa, CA 95401<br />
<a href="mailto:dick@cfcl.com">dick@cfcl.com</a>  Home +1 707-546-6760   Cell +1 707-228-9716</p>
<p>ps Put (or leave) &#8220;nitpicker&#8221; in the subject line to get past my spam filters.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matjaz</title>
		<link>http://flexonrails.net/?p=65&#038;cpage=1#comment-7745</link>
		<dc:creator>Matjaz</dc:creator>
		<pubDate>Sun, 18 Mar 2007 08:57:25 +0000</pubDate>
		<guid isPermaLink="false">http://flexonrails.net/?p=65#comment-7745</guid>
		<description>Hi,

if you want to load and instantiate a class at run-time try this:
1) compile a swf with a class you want to instantiate at run-time
2) load the compiled .swf file into ApplicationDomain.currentDomain
3) get the loaded class with ApplicationDomain.currentDomain.getDefinition(classPath) as Class

Here is a class that does this:

package klikfrikLib.utils.loaders
{
	import flash.display.*;
	import flash.errors.*;
	import flash.events.*;
	import flash.net.*;
	import flash.system.*;
	import flash.display.Loader;
	import mx.controls.Alert;

	public class ClassLoader extends Loader
	{
	    public static var CLASS_LOADED:String = &quot;classLoaded&quot;;
	    public static var LOAD_ERROR:String = &quot;loadError&quot;;
		
	    public function ClassLoader()
	    {
	    	super()
	    	contentLoaderInfo.addEventListener(Event.COMPLETE,classLoaded)
	    }
	    
	   private function classLoaded(ev:Event):void{
	   		var comEv:Event=new Event(Event.COMPLETE);
	        dispatchEvent(comEv);
	        
	   }
	    
	    public function loadClass(filePath:String, classPath:String):void
	    {
	         if(ApplicationDomain.currentDomain.hasDefinition(classPath)){
	         	classLoaded(null)
	        	//mx.controls.Alert.show(&quot;ClassLoader.loadClass = this class already loaded&quot;);
	        }else{
		       	var request:URLRequest = new URLRequest(filePath);
		        var context:LoaderContext = new LoaderContext();
		        context.applicationDomain = ApplicationDomain.currentDomain;
		        try{
		       		load(request, context);
		        }catch(er:Error){
		        	mx.controls.Alert.show(&quot;ClassLoader can&#039;t load= &quot;+er.message);
		        }
	        }
	    }
	        
	    public function getClass(classPath:String):Class
	    {
	    	
	        try
	        {
	            return ApplicationDomain.currentDomain.getDefinition(classPath) as Class;
	        }
	        catch(e:Error)
	        {
	            throw new IllegalOperationError(classPath + &quot; definition not found in &quot; + classPath);
	        }
	        return null;    
	    }
	    
	  
	}
}

And you use it like this:

classLoader=new ClassLoader();
classLoader.addEventListener(Event.COMPLETE, handleClassLoaded);
classLoader.loadClass(filePathToSwf, classPath);
private function handleClassLoaded(ev:Event){
   var clazz:Class=classLoader.getClass(classPath)
   var clazzObj=new clazz()
}


-Matjaz</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>if you want to load and instantiate a class at run-time try this:<br />
1) compile a swf with a class you want to instantiate at run-time<br />
2) load the compiled .swf file into ApplicationDomain.currentDomain<br />
3) get the loaded class with ApplicationDomain.currentDomain.getDefinition(classPath) as Class</p>
<p>Here is a class that does this:</p>
<p>package klikfrikLib.utils.loaders<br />
{<br />
	import flash.display.*;<br />
	import flash.errors.*;<br />
	import flash.events.*;<br />
	import flash.net.*;<br />
	import flash.system.*;<br />
	import flash.display.Loader;<br />
	import mx.controls.Alert;</p>
<p>	public class ClassLoader extends Loader<br />
	{<br />
	    public static var CLASS_LOADED:String = &#8220;classLoaded&#8221;;<br />
	    public static var LOAD_ERROR:String = &#8220;loadError&#8221;;</p>
<p>	    public function ClassLoader()<br />
	    {<br />
	    	super()<br />
	    	contentLoaderInfo.addEventListener(Event.COMPLETE,classLoaded)<br />
	    }</p>
<p>	   private function classLoaded(ev:Event):void{<br />
	   		var comEv:Event=new Event(Event.COMPLETE);<br />
	        dispatchEvent(comEv);</p>
<p>	   }</p>
<p>	    public function loadClass(filePath:String, classPath:String):void<br />
	    {<br />
	         if(ApplicationDomain.currentDomain.hasDefinition(classPath)){<br />
	         	classLoaded(null)<br />
	        	//mx.controls.Alert.show(&#8221;ClassLoader.loadClass = this class already loaded&#8221;);<br />
	        }else{<br />
		       	var request:URLRequest = new URLRequest(filePath);<br />
		        var context:LoaderContext = new LoaderContext();<br />
		        context.applicationDomain = ApplicationDomain.currentDomain;<br />
		        try{<br />
		       		load(request, context);<br />
		        }catch(er:Error){<br />
		        	mx.controls.Alert.show(&#8221;ClassLoader can&#8217;t load= &#8220;+er.message);<br />
		        }<br />
	        }<br />
	    }</p>
<p>	    public function getClass(classPath:String):Class<br />
	    {</p>
<p>	        try<br />
	        {<br />
	            return ApplicationDomain.currentDomain.getDefinition(classPath) as Class;<br />
	        }<br />
	        catch(e:Error)<br />
	        {<br />
	            throw new IllegalOperationError(classPath + &#8221; definition not found in &#8221; + classPath);<br />
	        }<br />
	        return null;<br />
	    }</p>
<p>	}<br />
}</p>
<p>And you use it like this:</p>
<p>classLoader=new ClassLoader();<br />
classLoader.addEventListener(Event.COMPLETE, handleClassLoaded);<br />
classLoader.loadClass(filePathToSwf, classPath);<br />
private function handleClassLoaded(ev:Event){<br />
   var clazz:Class=classLoader.getClass(classPath)<br />
   var clazzObj=new clazz()<br />
}</p>
<p>-Matjaz</p>
]]></content:encoded>
	</item>
</channel>
</rss>
