Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




FLV Asset Manager



'm working with a lms company to develop a system where the client uploads their FLV file as an asset and it is part of training course they set up for their employee training. I've got about 1000 flvs to manage and I'm trying to find the best way to go about accomplishing this task. I'm in a Java system and I'm guessing I need to create an external file that will be updatable and some how have the flash file to reference that file. I need a point in the right direction. Thank ry



Adobe > Flash Data Integration
Posted on: 12/10/2008 12:13:05 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Does Transition Manager Cancel The Tween Manager Effects ?
because as soon as I try to combine both transitions, one doesn't work
Example : onRollOver, a movie clip is supposed to fade in with pixel dissolve effect and of course onRollOut to "Yoyo".As far as I can go, only the fading goes on but the pixeldissolve effect does not work.
Can you help me or it is simply not possible.
Thank you .

Attaching Asset To A Class, And Maybe Class To An Asset? (Flex AS3)
Hey everybody!

I've posted this question in other flex and actionscript-centered forums, but got no answers so I thought it couldn't hurt if I asked it here. The post is long because I'm trying to express the problem with as much detail as possible, so bear with me

I'm somewhat new to Flex, coming from Flash CS3, so I'm most familiar with the Library paradigm and trying to port that knowledge to Flex. Here's a specific problem that I'm having...

I know you can attach embedded asset symbols to a full fledged class, similar to defining Linkage in Flash CS3. I'll be using a typical login dialog box to demonstrate this problem. Imagine that the Artist gave me an assets.swf that contained a LoginModule movieclip with a textfield for username input, a textfield for password input, and a button movieclip for clicking. I attach the LoginModule asset like so:


Code:
package ui.modules{
import flash.display.Sprite;

[Embed(source="/../assets.swf#LoginModule")]
public class LoginModule extends Sprite{

public var usernameTxtbox:TextField;
public var passwordTxtbox:TextField;
public var loginBtn:MovieClip;

public function LoginModule(){}
}
}
Works great like this! However.... I would like to have that particular login button behave like yet another class I have written, called CustomButton. All CustomButton is is a MovieClip with 2 frames, stopped at the first frame, but will move to the second upon mouseover:


Code:
package ui.controls{
import flash.display.MovieClip;
import flash.events.MouseEvent;

public class CustomButton extends MovieClip{
public function CustomButton(){
gotoAndStop(1);
addEventListener(MouseEvent.MOUSE_OVER,onMouseOver);
addEventListener(MouseEvent.MOUSE_OUT,onMouseOut);
}
private function onMouseOver(e:MouseEvent):void{
gotoAndStop(2);
}
private function onMouseOut(e:MouseEvent):void{
gotoAndStop(1);
}
}
}
This is where I'm stumped.

If the Artist gave me the asset.swf with that LoginModule clip with a button already attached, trying to force loginBtn in LoginModule to be a CustomButton using loginBtn:CustomButton would throw an error. In Flash, all I had to do was set the Button's Base class to ui.controls.CustomButton, but at this time it seems my only option is to ask the Artist not to include the button in the LoginModule, and allow me to include the loginBtn manually as a CustomButton. This would greatly hamper the Artist's duties, so I'd like to solicit some advice from the gurus out there: How do you handle situations like these?

Thanks for any and all help!
Jay

Where's The Asset?
I'm opening a very old (well...from the F5 days.) FLA that has a number of audio effects i'd like to reuse. The 'path' in the properties is a long deleted directory. But the audio still plays so it's still on my hard drive somewhere. How do i retrieve it?

Asset Management
me and a friend of mine are developing one game ( its pretty big) ... she does all the art and i do programming. we are currently facing problem to manage art and audio assets. like, i use whatever she gives to me, but then she modifies it and i have to integrate it all over again. are there any ways to manage assets effectively , with out any need to re-do stuff over and over again.

AS3 Asset Queue
I used to use this AS2 method to preload assets.

http://blog.greensock.com/preloadassetmanageras2/

But now I'm looking for an AS3 solution. Does anyone know if there's one out there already? It is so critical, I'm almost surprised it isn't part of the AS3 Framework.

[F8]Using A Loaded Swf's Asset On Another Level
Hi,
I am developing a compositional engine in modules, each module provides a different element to the engine.

Current hierarchy is:

Engine.swf
|
+----------ColorStripper.swf (provides array of available colors)
|
+----------PlotterPanel.swf (provides array of usable coordinates)
|
+----------Assets.swf (provides assets, and an array of linkage properties for available assets)


When I use attachMovie inside of the assets.swf file it works correctly, but when executed in engine.swf to attach movieClips exported inside of assets.swf it does not work.
For example (code inside of engine.swf): while trace(_global.assets[0]) will trace "dropObj" (a string which is a correct linkage property to a movieClip inside of assets.swf)
obj = attachMovie(_global.assets[0],"asset"+i,i);
trace(obj);
will trace "undefined"

is there any way to attach a movieClip loaded into assets.swf (_level3) with code being executed in engine.swf (_level0)?

the goal is to make the asset libraries swappable and independant, while the engine stays the same.

[CS3] Random Asset From Library
Hi, I need to be able to choose a random asset from my library and add it to the stage. I also need to be able to perform a hittest on that movieclip and have it reference a unique global variable.

Basically what I'm trying to make is something like that "fishy" game, if any of you have played it (although a little different, I'm using countries). I have a bunch of movieclips with graphics of different countries in them, and I'm going to have a class file with variables of different sizes (would that be the best way to store these variables, a class? And then have a bunch of lines like var countrySize:Number = .5;, one for each country?) So I need to have a random asset (country) load, move across the screen, and if it gets hit, reference a variable specific to the country contained in that movie clip.

This is the code I have so far:

countriesInGame = 10;
countryMaker = new Timer(2000, countriesInGame);
container_mc = new MovieClip();
addChild(container_mc);

countryMaker.addEventListener(TimerEvent.TIMER, createCountry);
countryMaker.start();

function createCountry(event:TimerEvent):void
{
var country:MovieClip;
country = new Country();
country.x = -1;
country.y = Math.random() * stage.stageHeight;
container_mc.addChild(country);
var countryTimer:Timer = new Timer(20);
countryTimer.start();
stage.addEventListener(TimerEvent.TIMER, countryMove);
function countryMove(event:Timer):void
{
country.x += 5;
}

So I need to know how to make it choose a random country from like 50 and load it. Also I'd like to know how to set a random speed and have it move across the stage and then disappear, cause that's not working yet. I have it set to move every 20 milliseconds with the timer, but it doesn't seem to be working.

Any help you guys can offer would be great. Thanks!

External Asset + RemoveChild()
Hey there- Quick question.

I have a simple button (btn1) that when clicked loads an external .swf (external.swf) to the display list, while also removing btn1 and showing btn2. External.swf includes a datagrid that allows the user to click on a row to load a new .swf (external2.swf), or if you click btn2, it removes external.swf and places the btn1 back. A simple navigation loop.

So My trouble begins when the user clicks the datagrid and external2.swf loads in place of external.swf. When btn2 is clicked it sucessfully removes external2.swf, but when you click the btn1 button again it reloads and displays external2.swf and not external.swf. How do I get the btn1 to show external.swf again and remove external2.swf? Any help is appreciated. Here's the movie in question:

http://www.fastmarketreport.com/flash/display_list.html

display_list.swf:

Code:
var swfLoader:Loader = new Loader();
var url:URLRequest = new URLRequest("external.swf");
swfLoader.load(url);

var container:Sprite = new Sprite();
var button1:btn1 = new btn1();
var button2:btn2 = new btn2();
button1.x = 100;
button2.x = 200;
button2.visible = false;

addChild(container);
container.addChild(button1);
container.addChild(button2);

button1.addEventListener(MouseEvent.CLICK, clicked);
function clicked(evt:MouseEvent):void{
container.addChild(swfLoader);
button1.visible = false;
button2.visible = true;
}

button2.addEventListener(MouseEvent.CLICK, clicked2);
function clicked2(evt:MouseEvent):void{
container.removeChildAt(2);
button1.visible = true;
button2.visible = false;
}
external.swf:

Code:
import fl.data.DataProvider;
import fl.controls.DataGrid;
import fl.controls.dataGridClasses;

bldRosterGrid(aDg);
var aRoster:Array = new Array();
aRoster = [
{Link:"external2.swf", Name:"External", Type:"SWF", Year:"2008"},
];
aDg.dataProvider = new DataProvider(aRoster);
aDg.rowCount = aDg.length;

function bldRosterGrid(dg:DataGrid){
dg.setSize(400, 300);
dg.columns = ["Link", "Name", "Type", "Year"];
dg.columns[0].width = 120;
dg.columns[1].width = 50;
dg.columns[2].width = 50;
dg.columns[3].width = 40;
dg.addEventListener(Event.CHANGE, changeHandler);
};

function changeHandler(event:Event):void {
//loads external2.swf
var swfLoader2:Loader = new Loader();
var url2:URLRequest = new URLRequest(DataGrid(event.target).selectedItem.Name);
swfLoader2.load(url2);
addChild(swfLoader2);
//removes external.swf
removeChildAt(0);
}

Scripting A Dynamic Asset
I have a movie that creates several movieclips dynamically, using attachMovie, each with a textfield (also dynamically created). I am able to set the text of the text fields and format their look. Everything seems fine.

Next hurdle.

How do I attach script to each movieclip that was created? I need to make these clips buttons to load a video from an external source. I know how to make the clip a button but how do I get that script to each clip - remember that each clip will have a unique script. I'm clueless as where to start on this since this is my first time creating something dynamically.

Thank you in advance!

Flash Psd Asset Configuration
hey, i'm just a newbie at actionscript 3 and have this problem. i have imported into my fla file as a library symbol a photoshop file (.psd). One of the assets is a bitmap consisting of an image against a transparency. The image is all one color. I want to change the color of the bitmap dynamically. Is there a way to do this?

Mass Asset Swaps
I need to replace a ton of art assets. Is there a trick to doing this in bulk? Or do I need put manually resetup each one?

Thanks,
T

Loading Asset Issue
What I'm trying to do is load an external "library" MovieClip, dynamicMCLibrary.swf, who's assets I want to instantiate on screen.

So the following works.

My main document class looks like this:


ActionScript Code:
package {

    import flash.display.Loader;
    import flash.display.MovieClip;
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.URLRequest;
   
   
    public class DynamicMCTests extends Sprite {
       
                // Instantiate animation from loaded swf library
        private var _anim:MovieClip;
       
        public function DynamicMCTests():void {
            loadLibrary();
        }
       
        private function loadLibrary():void{
            var _loader:Loader = new Loader();
            _loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,loadProgress);
            _loader.contentLoaderInfo.addEventListener(Event.COMPLETE,libraryLoadComplete);
            _loader.load(new URLRequest("dynamicMCLibrary.swf"));
        }
       
        private function loadProgress(e:ProgressEvent):void{
            trace("Loading: "+e.bytesLoaded+"/"+e.bytesTotal);
        }
       
        private function libraryLoadComplete(e:Event):void{
            addMC();
        }
       
        private function addMC():void{
                        //  "Anim" is the class name associated with the swf's
                        //  Linkage properties
            _anim = new Anim();
            addChild(_anim);
        }
       
    }
}

In my dynamicMCLibrary.swf, the linkage properties for the movieclip are

Class: Anim
Base Class: flash.display.MovieClip

And I also created an Anim class, which looks like:


ActionScript Code:
package {
    import flash.display.MovieClip;
    public class Anim extends MovieClip{
        public function Anim(){
            trace("Anim");
        }
    }
}

So all of the above works fine.

But in this dynamicMCLibrary.swf file, I have a series of these animations, called Anim1, Anim2, Anim3 and so on.

In the past, what I was able to do was set the linkage properties for each of those MovieClips as:

Class: Anim1
Base Class: Anim

Class: Anim2
Base Class: Anim

Class: Anim3
Base Class: Anim

So when the course is published the Anim1, Anim2, Anim3 classes are automatically generated and automatically extend the Anim class. And in my main class, I could call:

_anim = new Anim1();

But, I think because I'm loading my library as an external swf file, when I do this, I always get an 1180: Call to a possibly undefined method Anim1.

Am I correct in thinking this external library is part of my problem? Is there a workaround for any of this?

I need to be able to externally load this library and instantiate these animations like this.

Any help is always appreciated

Thanks
Chris

Loadind External Asset
After loading external asset sometime animations start playing even if there's a stop.It's like there is no stop and animation just loop. This problem is totally random.

Thanks

Flash Asset Management
Hello all:

The agency I work for currently is growing faster than it's asset management capabilities. We're all tired of asking around the office to see if somebody can close a file they are currently using. As we dig for solutions, I'm wondering if any of you wanted to share with me your experiences with different ways of managing files in a large agency setting. Our projects are large and dependent upon many files, so a solution like Quark DMS may not work. Please, post any information you have on the subject as we're growing very quickly and need a solution soon. Thanks!

[as3 In CS3] Does SWF Asset Embedding Work?
Flex developers have this neat "embed" whatchamacallit that allows them to throw assets from already compiled SWFs into their snooty rich internet applications. () You can read about it here- it's kinda neat.

Can Flash compile this kind of code? Because then, if I open-source a project, I could bundle a SWF with it that'd include Flash assets in case someone wants to compile my code without using the Flash IDE. And let's face it, who's going to look at an open-sourced animation? It's the code that people are interested in.

It'd also make it easier to share assets between projects, should the need arise.

Resizing A MC According To The Loaded Asset (jpg, Swf...)
Hi,

I have tried many things but when i load my external jpg inside a MC (thru the use of a MovieCliploader which then load the jpg inside that MC in an empty MC).
I have put my code in the onLoadInit() and did something like

MC._width = target._width;

My MC has a specified width and height in the library. is it because of that or should i put it smaller.

Using An Exported Asset In A Loaded Swf
Assume this scenario: SWF A loads SWF B. In SWF B is a library movieclip which has its linkage set for "export for actionscript". After it's loaded into SWF B, is there a way from SWF A to create a new class of this library movieclip (residing in SWF B's library?)

Embed Asset To Class
Why am I getting a "Instantiation attempted on a non constructor" error when I try to run this in Flash? Im trying to embed the pic, assign it to the class and addChild. This code works fine on some of my other scripts, copied exactly...am I losing it today?

ActionScript Code:
package
{
import flash.display.Bitmap;
import flash.events.Event;

import org.papervision3d.objects.primitives.Plane;
import org.papervision3d.view.BasicView;

[SWF(width="640", height="480", backgroundColor="#000000", frameRate="60")]
public class ExplodingPic extends BasicView
{
[Embed(source="assets/IMG_0009.JPG")]
private var hAsset:Class;

public function ExplodingPic()
{
var h:Bitmap = new hAsset() as Bitmap;
addChild(h);

}
}
}

Flash Asset Management
Hello all:

The agency I work for currently is growing faster than it's asset management capabilities. We're all tired of asking around the office to see if somebody can close a file they are currently using. As we dig for solutions, I'm wondering if any of you wanted to share with me your experiences with different ways of managing files in a large agency setting. Our projects are large and dependent upon many files, so a solution like Quark DMS may not work. Please, post any information you have on the subject as we're growing very quickly and need a solution soon. Thanks!

Does Preloading An Asset Make It Available To That Swf Only?
if i have 2 swf files and 1st preloads not only the 2nd swf but also external assets (images) that 2nd swf will be using, will the 2nd file have all the external images available from the first, will it know they're there ready?

Flash Asset Gathering?
Is there a feature in Flash, or a third party application that will look at your FLA and all linking files within it, and pull everything into one gathered folder?

Sort of like when you "package" a print job in Adobe Indesign?

Thanks!

How To Export Library Asset?
Hiya, I have this .FLA with a transparent .PNG in the library .... I need to re-work the image a bit more however I no longer have the original file to re-import.

So my question then IS... how can I export a transparent .png OUT of Flash and open it in Photoshop? I can do it no problem saving it as a .gif or .jpeg with the File>Export>Export Image options, but it adds the stage color to the image, and I really really don't want to spend another 2 hours tracing my image in Photoshop!!!

Please help US!!

Flash Asset Xtra To Director
I am using Flash 5 to export a Flash 4 movie for import into Director 8. The Flash movie has a button that start an animation sequence. Once the animation completes, I want Director to jump to the next specified frame. How do I code the Action in Flash5 and how do I code Director to wait on the Flash movie to finish and read the last frame of the animation before it jumps? Technote #5072 did not help.

thanks for your assistance...jc

Flash Asset Xtra To Director
I am using Flash 5 to export a Flash 4 movie for import into Director 8. The Flash movie has a button that start an animation sequence. Once the animation completes, I want Director to jump to the next specified frame. How do I code the Action in Flash5 and how do I code Director to wait on the Flash movie to finish and read the last frame of the animation before it jumps? Technote #5072 did not help.

thanks for your assistance...jc

Cross Domain Asset Loading
hi folks,
has anyone come across this before:

I have a flash application that does various things like booking vc equipment and meeting rooms over the web. It talks to PHP to do this. Before you can book something you have to logon. The logon is handled by a custom swf I wrote and is shared by other apps I have.
The booking application is on one subdomain, while the login swf is on another subdomain, both subdomains are under the same domain, which is allowed in Flash MX (loadMovie works). In Opera and IE it works fine but now and again, there's a version of IE6 that refuses to let the Flash player load the login swf from the other subdomain.

any ideas peeps?
Cheers,
Alistair

Determining If An External Asset Is Loaded
Hi, thanks in advance for at least trying to help me... here is my dilemma:

My site is a portfolio of my work, it loads all of the data dynamically out of an XML file, for each client node there are attributes such as photo1="print/inner-1.jpg"

I want the button that links to that image to load in to 50% opacity and then finish when it can tell that the image is fully loaded.

The problem is, for some reason it always views the external asset as 0kb therefore it thinks its already loaded. Any idea why? I was kinda thinking maybe theres a delay between when it sees the image and when it knows its total size?

for reference, my incomplete site is at http://work.haptic-data.com

Disabling A Drag-and-drop Asset?
Hello everyone.


I'm painfully new to actionscripting and need some advice on how to go about disabling a drag-and-drop object. Basically I have this puzzle I'm working on, and it has pieces that you can drag and drop into place. That was simple enough to implement. Now the problem is, once the piece is in place, I want to be able to disable the drag-and-drop functionality, so it cannot be mainuplated further.

How can I go about doing this? I've read through dozens of tutorials and looked through my flash Actionscript manual and help file, but nothing that I've seen gives any details or hints as to how to go about accomplishing this. If anyone could give me some advice, or point me in the right direction to resources that spell it out, I would be very appreciative.



Thanks in advance.

MoveiClipLoader - Load One Asset At A Time Or...?
I'm loading an XML list of JPGs, and I'm wanting to load the pics with the moveiClipLoader object and it seems to be working well so far.

Here's the question - can I use one moveClipLoader object and load multiple clips at one time? For instance:

for(i = 0; i < imgs_array.length; i++){
myMCL.loadClip(imgs_array[i],mc_array[i])
}

where imgs_array is of course an array of image paths and mc_array is an array of movieclips. Using that, can I monitor the progress of each image loading?

MoveiClipLoader - Load One Asset At A Time Or...?
I'm loading an XML list of JPGs, and I'm wanting to load the pics with the moveiClipLoader object and it seems to be working well so far.

Here's the question - can I use one moveClipLoader object and load multiple clips at one time? For instance:

for(i = 0; i < imgs_array.length; i++){
myMCL.loadClip(imgs_array[i],mc_array[i])
}

where imgs_array is of course an array of image paths and mc_array is an array of movieclips. Using that, can I monitor the progress of each image loading?

ReferenceError: When Class/asset Not Present
EDIT: Answer to below problem found (see at bottom):
---------------------------------------------
How do I detect whether a linked clip exists in my movie's library or not without getting a Reference Error?

I have a program that dynamically attaches library assets via the method:

var dynamicClass:String = "Ans_"+catname+"_"+questname;
getDefinitionByName(dynamicClass)

This works fine EXCEPT when the class does not exist in the library. In my program, I need to capture these cases in order to do something alternative. However, I can't get around the thrown ReferenceError. Simply calling the line

getDefinitionByName(dynamicClass)

will throw the error if the class isn't present.

Try.. catch didn't get around the error (although I'm shaky on how try catch can be used), and neither does:
if (getDefinitionByName(dynamicClass) != null) {


Is it possible to write some sort of conditional code? I hope there's a simple solution, or I've missed something somewhere, because it seems it should be possible to do this.

Thanks for any advice.

---------------------------
I just answered my own question:

function ReferenceErrorExample(dcn:String) {
try {
getDefinitionByName(dcn);
} catch (e:ReferenceError) {
trace(e);
//do alternative action
}
}
ReferenceErrorExample(dynamicClassName);

How Do I Add CDATA To Exsting Xml Flash Asset
Hi, I am a front end web designer/developer and analyst...struggling with putting an accordian flash xml menu together. I have it done except I need to add a simple trademark symbol circle with r. I am struggling with how to do this since I am not savvy in actioncript. I assume the best way is to add it is with a CDATA child node, but do not know how or whatever is the best way to get this done since am on a tight deadline. I need someone to explain step by step what I have to do to get this simple addition resolved. Attached are the links to home page and code for the xml file. The left navigation is the asset that I need to add the trademark symbol under about, about ADHERE. Thanks so much in advance!!!!!!
[URL=http://www.nodcreative.com/natrecor_sliced/natrecor_index.html]index page with flash xml menu asset[/URL]

xml code:

<?xml version="1.0" encoding="UTF-8"?>
<accodion>


<item name="HOME">


</item>


<item name="ABOUT">


<item name= "ABOUT ADHERE<![CDATA[write]]>"></item>

<item name="Medical Information" url="

Loading/Displaying External Asset
If I put this code in the main .as file, the image appears on the stage. If I put it into another .as file in the project, it doesn't appear. There is no error.

public function getGIF() {
gifImg = new Loader();
addChild(gifImg);
var urlRequest:URLRequest = new URLRequest("images/anemone.gif");
gifImg.load(urlRequest);
}

I've called the function this way:

var imgLoad:ImageLoader = new ImageLoader();
imgLoad.getGIF();

Getting up to speed on AS3. Help greatly appreciated.

Runtime Loaded Asset Seems To Have No Definition
Hi,


one of you forum readers might get the title for "AS-Guru of all time" pointing me the solution to THIS:

I'm publishing an SWF file on domainA and loading every graphical assets and included classes from another SWF located on domainB.
It's great.
Locally.

I mean that when the two files are loaded locally side by side, everything rolls fine.
As soon as I'm trying to load the assets library from domainB, I get a runtime error #1009 (null object reference).

The following "crossdomain.xml" is hosted on domainB :

Code:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" />
<allow-access-from domain="localhost" />
<allow-access-from domain="127.0.0.1" />
</cross-domain-policy>
but doesn't seems to accept remote serving of an SWF from another.
I worked my way around security issues by declaring in the first frame of the library SWF

Code:
Security.allowDomain("*");
(now that's security...)
and the library assets gets loaded fine from domainB, like this:

Code:
var path:URLRequest = new URLRequest(Config.SERVER_PATH + "assets/assets.swf");
var context:LoaderContext = new LoaderContext(true, ApplicationDomain.currentDomain);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onAssetsLoadComplete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onError);
loader.load(path, context);
Or do they?

The classes associated with the linked library assets gets loaded fine too, as I can instantiate them.
The thing is every time there's a sub-clip inside one of them, it doesn't seem to get defined at all.
For instance, I have SimpleButton called "replay_btn" inside a movieClip linked with "OptionsButtons" class.
I have this

Code:
public var replay_btn:SimpleButton;
in the class definition.

I repeat : this is working fine when

Code:
Config.SERVER_PATH = ""
not anymore when

Code:
Config.SERVER_PATH = "domainB"
Winners might get recognition.
A whole lot'of'it.

I know many chicks.
Please help.

[external Asset] Can't Get Width/height
Hi!

I've got a class, FileLoader, that loads swf. It dispatch an Event.COMPLETE.
There's a listener on Event.COMPLETE that add the swf to an empty movieclip called page.
Immediately after adding the swf to page, page dimensions still are == 0. Why?
If for ex. I then resize the window, I can retrieve them. Quite strange..

Can you help me please?

Here's the code:


Code:

//the container
var page = new MovieClip();
addChild(page);

function completeTest(e:Event){//Event.COMPLETE listener

//delete old movie
if(page.numChildren > 0){
loader.unLoad(); //loader here is an instance of a class of mine called FileLoader. unLoad() calls unload() to the internal Loader instance.
page.removeChildAt(0);
}

var swf = e.target.currentLoadedFile; //currentLoadedFile is a prop of FileLoader
page.addChild(swf);
//Here i cannot immediately retrieve page.width and page.height (they're == 0)
//if I then for example, resize the window, then I can retrieve them.
}

Adding Classes To An Asset Swf File
Hello,

I'm trying to create an asset swf file that contains references to external classes. I want to dynamically call this asset swf into the current program and access the contained class files.

I'm using the following code to load the swf.


Actionscript Code:
var swfLoader:Loader = new Loader();
var swfRequest:URLRequest = new URLRequest("swfs/assets.swf");
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);    swfLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
swfLoader.load(swfRequest);
 
function onCompleteHandler(event:Event):void{
  var Square:Class = event.target.applicationDomain.getDefinition("Square") as Class;
  var mySquare:MovieClip = new Square() as MovieClip;
  addChild(mySquare);
}

This code works fine if the class I'm trying to reference is stored in the library of asset.swf (linked for actionscript).

However, I can't figure out how to embed external class files into asset.swf and have be accessible using the above code.

Any help would be greatly appreciated.

Thanks!

Freehand For Flash MX: Asset Or Redundancy?
Hi,

I'm playing wit the Flash MX tutorial (trial version) and I see many similarities between the graphics editor for Freehand and Flash.

Does Freehand MX have some gutsy attributes that Flash MX does not have?

Is there a significant advantage to developing graphics in Freehand and then importing them into Flash?

Is it worth the extra $300 for the Freehand software?

Thanks,

Rougy

-----
The death of dogma is the birth of reason.

Infinite Scroller Asset Question
Last edited by Anik : 2008-04-17 at 09:25.
























Hi I downloaded the infinite scroller asset from Rumi but I want to alter the code so that its NOT INFINITE and just scrolles right and left. Does anyone or Rumi know how to do this. I would appriciate the help I'm sure its just a really simple change. Thanks Aoife

Determining If An External Asset Is Loaded
Hi, I'm in the middle of creating a portfolio site and I'm almost done, but there is one kink I still can't work out.

My site loads client and picture data out of an xml file each picture is then loaded into a movie clip. And if there are say 4 images, then there are 4 buttons to go to each, I want each button to stay at 50% opacity until it can tell that the jpeg is loaded, but unfortunately it always sees the movie clip as 0 bytes and therefore already thinks its loaded.
I was thinking maybe this was due to a delay between when the asset is set up and when the asset's size is known, but no matter what I can't get the jpeg's file size to ever appear as anything other than 0kb (even if I add a loop until the total size is more than 0).

So my question is:
How can I get flash to see the actual file size of the movie clip with the image and determine if it is loaded?

Thanks in advance!

Runtime Loaded Asset Seems To Have No Definition
Hi,


I'm looking for a way to make THIS work:

I'm publishing an SWF file on domainA and loading every graphical assets and included classes from another SWF located on domainB.

When the two files are loaded locally side by side, everything works fine.
As soon as I'm trying to load the assets library from domainB, I get a runtime error #1009 (null object reference).

The following "crossdomain.xml" is hosted on domainB :
Code:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" />
<allow-access-from domain="localhost" />
<allow-access-from domain="127.0.0.1" />
</cross-domain-policy>
but doesn't seems to accept remote serving of an SWF from another.
I worked my way around security issues by declaring in the first frame of the library SWF
Code:
Security.allowDomain("*");
and the library assets gets loaded fine from domainB, like this:

Code:
var path:URLRequest = new URLRequest(Config.SERVER_PATH + "assets/assets.swf");
var context:LoaderContext = new LoaderContext(true, ApplicationDomain.currentDomain);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onAssetsLoadComplete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onError);
loader.load(path, context);
Or do they?

The classes associated with the linked library assets gets loaded fine too, as I can instantiate them.
The thing is every time there's a sub-clip inside one of them, it doesn't seem to get defined at all.
For instance, I have SimpleButton called "replay_btn" inside a movieClip linked with "OptionsButtons" class.
I have this
Code:
public var replay_btn:SimpleButton;
in the class definition.

This is working fine when

Code:
Config.SERVER_PATH = ""
not anymore when

Code:
Config.SERVER_PATH = "domainB"
Help, I'm out of ideas...

How Do I Access An Asset From An AS3 Class File?
My project is such: I've created a row of MovieClip buttons. I want to create a proper AS3 version of a custom Icon class so I can store all the data about each button as a separate 'Icon' object which links to it's appropriate MC, so I can assign onPress events and such.

I could probably figure out how to make it work if I could understand how the externally loaded AS file references a pre-existing asset. I've read a couple of AS3 books, but the typical 'ball' examples of object classes always refer to dynamically created art using the drawing api. When I try to refer to a library instance from the external as file, the compiler can never find it.

Can someone link me to an example of an .as class file that takes a reference to a preexisting mc asset in the constructor, or possibly whip up a skeleton example.
Maybe I'm just thinking about it all wrong, any help would be greatly appreciated.

thanks,
-J

Shared Asset & Exporting For Actionscript
I have 2 sounds file in my shared asset.

I'm exporting them for runtime as well as exporting for actionscript too.

Can i retreive those sounds thru actionscript in my other movie.

Like, to call shared sounds

mysound = new Sound();
mysound.attachSound("sharedsound");
mysound.start();


I have tried to retreive them, but fail

What Is An Acceptable Scale Percentage For An Image Asset?
What is an acceptable scale percentage for an image asset?

Determning The Size Of A External Asset While Loading
Ok the scenario is I am trying to load an external photo into a Empty Movie Clip and then execute a function after the photo (.jpg) of course has completly loaded how do I do this?

I know the onLoad function and its application for XML or data, but how do I accomplish this for a JPEG or SWF?


Thanks,
Brad.

K I figured this much out

theImage = "test.jpg"
holder.hold.loadMovie(theImage)
this.onEnterFrame=function () {
var picLoaded = holder.getBytesLoaded();
var picBytes = holder.getBytesTotal();
if (picBytes == picLoaded){
trace("loaded")
}
}

how do i exit the function that when the condition is satisfied?
OR should I use another method?

Free Code: Asset Loader Class
Hey everyone! It's been awhile since I posted code but now that I'm freelance I have my peaks and valleys of free time. Last week I had some down time and cleaned up a class I use all the time for preloading lists of external assets. This is the first bundle and it will no doubt have some issues. I use it upfront at the beginning of movies in a base container fla as well as inside other classes like galleries or menus.

In all honesty I just want feedback on my practices. Let me know your thoughts on the idea of the class in general and of course your thoughts on the class at a code level.

Please enjoy and I hope you gain something from it.

http://blog.bmace.com/2007/09/16/assetloaderas/

Embedding Asset Folder Into Compiled Swf - Impossible?
Hi folks,

I'm using some code which loads various assets (images, xml data) at runtime using the URLLoader.load() method. In my project folder, along with the .fla itself, I have an asset folder, and I am using relative paths to the assets in this folder for the URLLoader. All good and well when I test locally.

However, when I distribute my program (which is in fact a game), I want the entire thing to be contained within a single swf. I don't want to have to distibute the asset folder with it for installing onto whichever server the game is running on, and I don't want it crosslinking to my server either to get the assets. So the question is, is there some way of embedding the asset folder into the swf at compile time so that it can find the assets it needs at runtime? I'm aware of something like this in Flex (the [embed] tag), but I can't find a way in Flash.

Any ideas?

Thanks

Newbie, Please Help, How Do I Add CDATA To Exsting Xml Flash Asset
Hi, I am a front end web designer/developer and analyst...struggling with putting an accordian flash xml menu together. I have it done except I need to add a simple trademark symbol circle with r. I am struggling with how to do this since I am not savvy in actioncript. I assume the best way is to add it is with a CDATA child node, but do not know how or whatever is the best way to get this done since am on a tight deadline. I need someone to explain step by step what I have to do to get this simple addition resolved. Attached are the links to home page and code for the xml file. The left navigation is the asset that I need to add the trademark symbol under about, about ADHERE. Thanks so much in advance!!!!!!
[URL=http://www.nodcreative.com/natrecor_sliced/natrecor_index.html]index page with flash xml menu asset[/URL]

xml code:

<?xml version="1.0" encoding="UTF-8"?>
<accodion>


<item name="HOME">


</item>


<item name="ABOUT">


<item name= "ABOUT ADHERE<![CDATA[write]]>"></item>

<item name="Medical Information" url="

URGENT - Please Help (externalInterface Usage If Flash Is An Asset)
Hi!

Old 'liveConnect' object is ot working in Firefox. This renders using
'EvalScript()' JavaScript function useless while communicating from
browser to embedded Macromedia Shockwave (Director not Flash !) movie.

Seems the only solution for this problem is using Flash asset inside
Director movie as a gateway.

One ulky solution was published by Valentin Schmidt here:

http://staff.dasdeck.de/valentin/lingo/dir_js/

But this is old method - prior externallInterface class was implemented
in Flash.

Do you have any idea how to use externalInterface interface in case of
Flash embedded in Shockwave in a purpose to receive browser events sent
from JavaScript???

Rgs,
Ziggi

Adding CDATA To An Existing Xml And Flash Asset
Hi, I am a front end web designer/developer and analyst...struggling with putting an accordian flash xml menu together. I have it done except I need to add a simple trademark symbol circle with r. I am struggling with how to do this since I am not savvy in actioncript. I assume the best way is to add it is with a CDATA child node, but do not know how or whatever is the best way to get this done since am on a tight deadline. I need someone to explain step by step what I have to do to get this simple addition resolved. Attached are the links to home page and code for the xml file. The left navigation is the asset that I need to add the trademark symbol under about, about ADHERE. Thanks so much in advance!!!!!!
[URL=http://www.nodcreative.com/natrecor_sliced/natrecor_index.html]index page with flash xml menu asset[/URL]

xml code:

<?xml version="1.0" encoding="UTF-8"?>
<accodion>


<item name="HOME">


</item>


<item name="ABOUT">


<item name= "ABOUT ADHERE<![CDATA[write]]>"></item>

<item name="Medical Information" url="

Adding CDATA To An Existing Xml And Flash Asset
Hi, I am a front end web designer/developer and analyst...struggling with putting an accordian flash xml menu together. I have it done except I need to add a simple trademark symbol circle with r. I am struggling with how to do this since I am not savvy in actioncript. I assume the best way is to add it is with a CDATA child node, but do not know how or whatever is the best way to get this done since am on a tight deadline. I need someone to explain step by step what I have to do to get this simple addition resolved. Attached are the links to home page and code for the xml file. The left navigation is the asset that I need to add the trademark symbol under about, about ADHERE. Thanks so much in advance!!!!!!
[URL=http://www.nodcreative.com/natrecor_sliced/natrecor_index.html]index page with flash xml menu asset[/URL]

xml code:

<?xml version="1.0" encoding="UTF-8"?>
<accodion>


<item name="HOME">


</item>


<item name="ABOUT">


<item name= "ABOUT ADHERE<![CDATA[write]]>"></item>

<item name="Medical Information" url="

Copyright © 2005-08 www.BigResource.com, All rights reserved