Or if you have the SWC downloadable you can just copy the file near the FLA
file, flash will load it automatically.

Romu
www.soundstep.com


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sidney de
Koning
Sent: 15 May 2008 15:51
To: Flash Coders List
Subject: Re: [Flashcoders] Question about Google Maps Flash APIs

YUP :)

An swc file is notthing more than a zip file. So when you rename it to  
zip you can extract it, probably there is a library.swf in there.
This is what you do is this you load it in in Flash like this:

import flash.display.Loader;
//
var ClassFileForHoldingGooglesAPIClass:Class;
// Create these for everyclass you want to extract.
//
function loadAssets():void
{
var assetLoader:Loader = new Loader();
assetLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,  
assetLoaderComplete);
assetLoader.load(new URLRequest("library.swf"));
}

When the library.swf is done loading it calls the assetLoaderComplete  
handler that handles the
request and utilizes the getDefinition() method to get the class  
definition by a string.

function assetLoaderComplete(evt:Event):void
{
// remove your listener
evt.target.removeEventListener(Event.COMPLETE, assetLoaderComplete);
var appDomain:ApplicationDomain = evt.target.applicationDomain;

ClassFileForHoldingGooglesAPIClass =  
appDomain.getDefinition("com.google.maps.api.Whatever") as Class;
}

Now can create and instance of the MyOwnButton, simply by calling:

var myNewObject:Class = new ClassFileForHoldingGooglesAPIClass();

Or call functions on the  ClassFileForHoldingGooglesAPIClass.

Hope this is what you mean.

Cheers,

Sidney


On May 15, 2008, at 3:41 PM, eric e. dolecki wrote:

> They offer up a SWC, any way of using that in the Flash IDE without  
> using
> FlexBuilder?
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to