User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Best way to send messages to sub-application?

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Best way to send messages to sub-application?

    Wondering what's the best way to send a message (such as 'mybutton' clicked) from the main app to a sub app and vice-versa? It doesn't have to be text, just a simple switch event.

    Global values are actually one of the worst ways, given that you have to constantly check for them to ensure responsiveness, this chews up precious CPU.

  2. #2
    Clicker

    Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    J3sseM's Avatar
    Join Date
    Feb 2013
    Location
    Finland
    Posts
    868
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Well, I'd say global values. Depending how you use sub-app, can you put the global value event in a group and activate accordingly? This way it would not check it constantly.
    Other way is that maybe you could add an cooldown? Value A => 0 = Check the global value.

    Just thoughts, not sure if these would work for your needs.

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah this is what I'm already doing and it's not optimal. Kernel can send messages between applications that are kind of like 'on click' events, meaning they only activate when they occur, but Kernel object has been so hit/miss for me with reliability I'm very hesitate to use it.

  4. #4
    Clicker The Games Factory 2
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    jobromedia's Avatar
    Join Date
    Feb 2013
    Location
    Stockholm, Sweden
    Posts
    225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry if I come off as blatantly ignorant here, that's not my intention anyways. A bit more info would be good to have. What does your main application do, and what does the sub application do?

  5. #5
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lets say somebody clicks on a button in my sub-app. I want to tell my main app 'button was clicked'

    Set global value to 1
    Global value = 1
    - do this

    is fairly inefficient because 50 frames a second it's checking 'is global value 1'.

    On mouse button pressed does not check 50 frames a second because it's a windows message to the application, it only checks when window receives a message. I'm trying to do something similar, just wondering if anyone else has had experience with this.

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleFirefly 3D ModuleInstall Creator Pro
    twister's Avatar
    Join Date
    Jan 2007
    Location
    Pacific Northwest USA
    Posts
    347
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    I've always used global values and strings, but this got me curious. I did a test and set a counter as a global object, copied and pasted it on frame 2. When the counter was set to 1 on frame one, frame two counter was also set to 1 (jump to frame two). However, when I set frame two to be used in the sub application, the counter on frame two never changed. Might be something I missed. You may want to look into it further. I did a search in help in CF for "global object".

  7. #7
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Location
    USA
    Posts
    2,980
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Would using "only one action when event loops" work in your situation? It would limit the checking, but I get the impression that won't help you since you mentioned having to constantly check to ensure responsiveness with the subapp. And it sounds like what you're doing is advanced so I imagine if that was a possibility you'd have already done it.

  8. #8
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,015
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    Ryan, in your main app don't check for A = 1.

    Check that A <> 0 then activate a group that handles all the A= conditions. I understand you will be trying to make your app consume as less cpu as poss but activating the split second it's needed. Unfortunately your app is a background process, effectively so the user has to allow for a slight overhead.

    This is the best method I can think of out of allmy years practicing n developing similar techniques.
    Want to learn Clickteam Fusion 2.5?




  9. #9
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's interesting Danny,
    Would using Kernel / Windows Message Pro to send a message to the main app be more efficient than this or less efficient?

    I'll implement A <> 0. The problem is amplified in my case, because I don't have one button, but I have about 12 that need to communicate with the main app. Perhaps I'll create a 'Message Sent' global variable that the main app checks for and activates a group to receive all messages, this would eliminate the amplification of the problem.

  10. #10
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,015
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    I would say using Kernel or Windows Message Pro (in terms of efficiency) is def. less efficient as you're adding an additional overhead (going around the houses so to speak). Communicating with the app via shared Global Values is near-native as you can get so that would def. be the most efficient approach.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Help Messages
    By Pixzel in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 25th March 2011, 10:43 PM
  2. [request] send/receive sms messages extension
    By cel in forum Extension Development
    Replies: 4
    Last Post: 24th August 2009, 01:47 PM
  3. Encrypting messages in Moo
    By Plooscva in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 24th February 2007, 11:49 AM
  4. Messages Box object - Bug
    By Gustav in forum File Archive
    Replies: 9
    Last Post: 26th November 2006, 03:29 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
  •