User Tag List

Results 1 to 2 of 2

Thread: code in actives?

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Dec 2014
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    code in actives?

    Hello, recently I've been hearing about and seeing active objects that apparently have code in them? I was wondering how to do this and if there's any benefits. Sorry if I didn't explain this well enough.

  2. #2
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,544
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    What you see are called "Behaviors". They are a way you can organize your code, useful if you want to copy/paste objects into different frames with code attached to them.
    If you right click on an object in the level editor, and select properties, the second from the right tab is called "Events", it has a mini picture of the event editor, inbetween the A-Z (values) and Quote bubble (about) tabs. In this tab, the bottom area is your list of behaviors for that object. You can click the new button to add a new set of code, and click to edit it will bring you to an event editor just for the behavior code. When in this event editor, you can import objects from the frame so they will be selectable in the event editor.

    You asked the right question for sure though, in "If theres any benefits". In reality, behaviors don't add any extra functionality to your project at all. Effectively, the code in your behaviors is just copy/pasted into the event editor at runtime, added below all the regular code in the frame. There isn't any extra tools or abilities you can do in behaviors that you couldn't do in the normal event editor. Instead, the advantage of behaviors is a way to organize your code to make it less cluttered, easier to read and easier to port between frames and such. It might make keeping track of the code related to each object be less of a headache, or let a widget be copy/pasted from an example file into a project with code ready to use. The disadvantage is that you don't have as much control over what order your code is executed, you can't put behaviors above or below normal code.

    Behaviors are kind of tricky to find in the help files, search the help index for "Event Properties" and its described there;
    Behaviors.
    Behaviors are a list of events, specific to the object. Using the Edit button in this property, you can open a new event editor to edit this list of events. Your object will be the only one listed. You can import new objects with the "Import object" button. You define your events as usual.
    The great advantages of the behaviors is that the events are integrated in the object's properties : it means that if you copy the object, the behaviors will be copied at the same time.
    Example : you create a button that makes a click. Create a behavior that plays the sound "click" when you press the button. Then if you copy this object to another frame, it will click automatically when pressed.
    Note that behavior code isn't run on a per-object basis as it might give the impression. If you have 10 copies of an object with an event saying "Upon pressing space bar, add 1 to counter", it would just be the same as having a single copy of that line in the event editor, it will only execute once, not ten times.

Similar Threads

  1. Possible Y position bug of actives
    By nivram in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 17th November 2011, 11:00 PM
  2. is this a bug ? stacking actives
    By mikec in forum Multimedia Fusion 2 - Technical Support
    Replies: 43
    Last Post: 17th November 2011, 11:42 AM
  3. 3D Actives Object?
    By KLiK-iT in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 29th September 2011, 01:45 PM
  4. Editing Actives
    By Guitaristinmakin in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 31st March 2008, 07:12 PM
  5. V-Code Generator Source Code
    By LB in forum File Archive
    Replies: 1
    Last Post: 10th March 2008, 08:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •