From: Mike Blaustein on
I don't know if this is your problem or not (it is likely at least part
of it), but Director can not handle AS3 very well (generally, it can't
handle it at all). Try using AS2. Sometimes that works... like Rob
said, though, keep it externally linked to Director.
From: Ex Malterra on
[q][i]Originally posted by: [b][b]Rob Dillon[/b][/b][/i]
Which version of Flash and which version of AS? If you are trying to import an
XML file then be sure that you link the .swf to the Director movie and not
fully import it. The .swf must remain outside the Director movie so that it can
get to the external xml file.[/q]



From: Ex Malterra on
Sorry for the double post, some wierd snafu with my browser...

[q][i]Originally posted by: [b][b]Scott_K[/b][/b][/i]
I have a flash application that initializes by reading in an XML file.[/q]

Do you mean that XML.load() is called? Is the XML file local? It should work
fine. Below are some code snips from a Flash CS3(AS2)/Director 11 hybrid piece
I'm working on. It's for a projector that uses an imported Flash SWF that has a
tree component in it to represent a selected XML file. Hopefully it'll help you
figure out what's going on with your project.

[q][i]Originally posted by: [b][b]Rob Dillon[/b][/b][/i]
If you are trying to import an XML file then be sure that you link the SWF to
the Director movie and not fully import it. The SWF must remain outside the
Director movie so that it can get to the external XML file.[/q]

It's been my experience that that's not the case, either with MX 2004 or 11...
at least with loading XML files. I'm unsure what's meant by "import", I've
never done that. I'd be interested to know what the difference is, and why
loading works and importing doesn't.



// Flash stuff
// instantiate XML object, define loadTree function, override XML object's
onLoad

////////////////////////////////////////////////////////////////////////////////

import mx.controls.Alert;


////////////////////////////////////////////////////////////////////////////////
////////// XML Object

////////////////////////////////////////////////////////////////////////////////
var treeXml:XML = new XML();
treeXml.ignoreWhite = true;

function loadTree(thePath):Void
{
treeXml.load(thePath);
}


treeXml.onLoad = function (success:Boolean)
{
(success) ? contentTree.dataProvider = treeXml.firstChild : Alert.show("Error
Loading XML");
};


// Director function called by a button component
// the function calls the loadTree function in the SWF,

////////////////////////////////////////////////////////////////////////////////

function doButton(me, obj)
{

var fObj = _global.fObj; // FileXtra4 object

switch (obj.target.label)
{
case "Choose Lesson Folder":

_global.lessonPath = fObj.fx_FolderSelectDialog("Select a Lesson
Folder");

if (lessonPath.length > 1)
{
sprite("contentTree").loadTree(_global.lessonPath +
"\\content_custom\\content.xml");
// more stuff follows...
}

break;
}
}

From: Scott_K on
AS3 does not work with Director 11? That may hose it for me.

anyone have the reverse code snippet, that of Director calling down to the
flash objects actionscript methods? Or is that not working because this is AS3?

I have thousands of lines of code written, all AS3 specific, so this flash app
is not going AS2....

From: Scott_K on
I made a test Flash swf, it has a function, CallTest("test").
Imported into Director11, on the timeline called
sprite("mySprite").CallTest("director test 1");

The error is:

Script error: Handler not defined
sprite("mySprite").CallTest("director test 1");
#CallTest


Am I supposed to do something in Director to expose the function in the Flash
Object? Or is this just not working becuase this is AS3?




First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: Tools Question
Next: Smoother Blending?