Flex Components in Plugin

  • The combobox plugin I believe was created using the flex combobox, my question is how is this accomplished? The source code for this plugin is not included with krpano. Basically, what would a mxml file that defines a plugin need to look like?

    Regards,

    Adam

  • I tried to develop some plugins with the full flex sdk (not only with an action script class) - works well, except for the event handlers.
    I did'nt manage to register events like PLUGINEVENT_REGISTER or PLUGINEVENT_RESIZE, no event is fired. Do you have any idea on this?

    Thanks for this gorgeous player!
    Nils

  • Hi,

    can you show how you have registered these events,
    I think they should work in flex too

    best regrads,
    Klaus

    Hi Klaus,

    i use the following:

    Code
    krpano = krpano_as3_interface.getInstance();
    krpano.addPluginEventListener(this, krpano_as3_interface.PLUGINEVENT_RESIZE, pluginResize);

    The corresponding handler:

    Code
    private function pluginResize(e:DataEvent):void {
         krpano_trace(1, "resize");
    }


    since the PLUGINEVENT_REGISTER isn't also fired, i register the events in an init()-function, called from creationComplete in <mx:Application>
    Btw: I use the latest Beta of KRPANO.

    Thanks,
    Nils

  • This is a guess, but if your mxml uses an Application tag rather than a MovieClip or a Sprite this might be the source of the issue. I am basing my guess on the 'this' parameter that is passed to the addPluginEventListener functions, 'this' if you are using a Application tag will be a different datatype than if you said 'this' with a movieclip or a sprite. Try replacing mx:Application with flash:Sprite or flash:Movieclip. Also add xmlns:flash="flash.display.*" in order for the flash namespace to work. I would be very interested in seeing you mxml if you do not mind sharing...

  • Hi,

    sorry, I have no answer at the moment, I still need to test with "mxml" apps,
    it could be possible that it would be nessecry to set the parent or parent or the parent for mx apps:

    e.g. - try:

    Code
    krpano.addPluginEventListener(this.parent, krpano_as3_interface.PLUGINEVENT_RESIZE, pluginResize);


    or:

    Code
    krpano.addPluginEventListener(this.parent.parent, krpano_as3_interface.PLUGINEVENT_RESIZE, pluginResize);

    best regards,
    Klaus


  • it could be possible that it would be nessecry to set the parent or parent or the parent for mx apps:


    Unfortunatelly it's not possible. I've tried many variations using root, parent.parent.parent.parent, and other possibilities.
    Please someone solve this problem it would be very very nice to write plugins in Flex unfortunatelly without ability to fetch plugin object defined in krpano xml file (event ON REGISTER) plugins are useless.
    Please solve this one.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!