AS3 - Agregar objeto de la biblioteca con propiedad de clase example.exampleClass

Tengo una pregunta:

I have in Fla Library a object with the Class property like: com.tool.zoom linked to external as.

In timeline i call with:

mainApp.iniZoom("com.tool.zoom");

This fla is loaded in another FLA on I call iniZoom function.

It is posible? I get error 1007.

I hope you understand me, my english is not really good.

¡Gracias!

preguntado el 28 de agosto de 12 a las 10:08

1 Respuestas

As I understand you, you are trying to instantiate a class exported from a FLA file. You select that object, do Export for Actionscript, and name class "com.tool.zoom", right? If so, you should use "new" clause like this:

var iniZoom:com.tool.zoom = new com.tool.zoom();

Obviously you need to have the AS file available at compile time.

Edit: given that you load the SWF, aquí is the solution that might work for you. Note you have to load all the classes you want to export from the SWF for your parent SWF to be available.

Respondido 28 ago 12, 13:08

Thanks for the fast response! I get two error: 1046 Not found at compilation time zoom. 1120 Access to undefined property com. My version is in spanish, I translate the errors the best i can. Thanks! - murb83

What is the exported name for your FLA asset you want to load into another FLA? Can you import the FLA with that asset into your library when you design the loading FLA? - Vesper

I will try to explain, the structure are one Main.swf who loads other .swf when I click a button. These .swf have on library the Object with the class com.tool.zoom(), this object have graphics etc. on .swf. That object are loaded if I click a button and sends that object with the class to show on Main.swf. The why I send the object, is because that object i want to show on specific movieclip on the Main.swf. I hope can understand me :) - murb83

En este caso, espero aquí is a solution you can employ. At least it looks like you're trying to do exactly what's asked in there, get an asset from a loaded SWF. - Vesper

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.