calling functions from a different class from view

nino ross rodriguez's Avatar

nino ross rodriguez

13 Jul, 2012 09:17 AM

Hi all,

Im just a newbie here. I would like to ask how to call a function from a different class for a movieclip in the view? I have an asset called from my asset and added on the stage. then i need to call a function from a different class to initiate its properties. How do i do that?

  1. 1 Posted by Stray on 13 Jul, 2012 09:27 AM

    Stray's Avatar

    Hi there,

    I think there are some other, better places to ask this question.

    Not that newbie questions aren't welcome, but teaching / helping beginners is quite a specific skillset, and most people using robotlegs will have forgotten how they learned to do the things you are asking :)

    You could try http://www.actionscript.org/forums

    They have a more mixed readership, lots of whom are just starting out, so you'll probably get better support from them.

    I hope that helps - it's not that you're not welcome, but that I know that I'm struggling to answer your question, and I expect most regular users of this forum will be too.

    Stray

  2. Support Staff 2 Posted by Ondina D.F. on 13 Jul, 2012 11:46 AM

    Ondina D.F.'s Avatar

    Hi Nino,

    You gave us a very vague description of your use case ;-) So a vague answer would be: Use VOs (value objects) and Models.

    How much of a noob are you?
    If MVCS is completely new to you, you should start with reading the documentation and tutorials:

    https://github.com/robotlegs/robotlegs-framework/wiki/Best-Practice...

    http://joelhooks.com/2011/03/12/an-introduction-to-robotlegs-as3-pa...

    http://joelhooks.com/2011/03/12/an-introduction-to-robotlegs-as3-pa...

    Search the discussions on this forum for VOs, value objects, and models.

    Look at examples:

    http://www.robotlegs.org/examples/

    http://knowledge.robotlegs.org/discussions/resources/33-links-to-ro...

    If VOs and Models make sense to you already, then please give us more details about your use case, and we’ll try to give you a specific answer.

    I have an asset called from my asset and added on the stage. then i need to call a function from a different class to initiate its properties.

    What kind of properties has your „asset“? How does the function in that “different class” look like, what is it doing exactly?

    If your “asset” would be an image, and it had properties like imageID, imageName, imageLabel, etc, you’d store them in an ImageVO. It depends on your real use case whether you need an ImageModel or not. Maybe that “different class” you mentioned is a Model. Maybe not.
    And again, it depends on your specific scenario if you need to have the entire chain of ImageView->dispatch event->ImageMediator->redispatch event->ImageCommand->ImageModel->set/update image data->dispatch event with ImageVO as payload->ImageMediator->pass ImageVo to ImageView->set image data, or something much, much simpler.

    So, help us understand what you want to achieve.
    Ondina

  3. Ondina D.F. closed this discussion on 14 Aug, 2012 05:49 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac