User Tag List

Results 1 to 10 of 10

Thread: Get parameter from an external text file

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Oct 2010
    Location
    Hamburg / Germany
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Get parameter from an external text file

    Hi folks!

    I just bought MMF2 Developer and I started away with some basic tutorials from the Clickteam website. My main purpose for using MMF is developing small multimedia stuff for embedding on websites, so I also got the Flash Exporter.

    Now I am doing some little experiments to get myself warm.

    My question: I´ve got 1 avtive object, and I want to scale it to a certain height. The height I want to get from an external text file that is in the same directory as the swf file. Which object should I use for reading the external file and retreiving the height value?

    Regards,
    padawan

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Get parameter from an external text file

    The Get object can get any file from any place on the web.
    Working as fast as I can on Fusion 3

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Oct 2010
    Location
    Hamburg / Germany
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Get parameter from an external text file

    Thanks, LB! I played a little with the Get object. How would be the basic way if I want to retrieve a value from an external file using the get object, and how can I assing it as the Height of an Active Object?

  4. #4
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Get parameter from an external text file

    Just get the text file, ans when the get request is complete, just set the height accordingly.
    Working as fast as I can on Fusion 3

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Oct 2010
    Location
    Hamburg / Germany
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Get parameter from an external text file

    I thought I just give it a try :-) I set up a text file that contains nothing but the interger value 140, named it "data.txt" and uploaded it to www.mydomain.com.

    I started a new project in MMF as build type SWF. Then I inserted an active object and the get object into one frame. I added the events

    - Frame: On Start of Frame -> Get Object get URL "http://www.mydomain.com/data.txt"
    - Get Object: On get ready -> x-scale Active Object to fixed value retrieved from Get Object.

    I build a SWF file from it and also upload it to my webserver.

    The result is no success. The Active Object just flashes up one time in unscaled state, then disappears and doesn´t show again.

    Can you give me a hint what I did wrong?


  6. #6
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Get parameter from an external text file

    You need to divide the received number by the size of your active.

    Remember that 1.0 is normal size, 0.5 is half, and 2.0 is double. Imagine what 140.0 is! Thus, dividing it by the size of the active results in the correct displayed size.
    Working as fast as I can on Fusion 3

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Oct 2010
    Location
    Hamburg / Germany
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Get parameter from an external text file

    Thanks for your reply, LB, but it still doesn´t work right :-(

    I need to debug... so I wrote the retreived content from the get to a string object which I also put into my one frame. This works the string object shows the numeric value I put into the textfile (I took the value "3" this time to save me additional arithmetics). But the scaling of the active object according to retreived value still doesn´t work. The active object is not visible at all after I try to set x-scale to Fixed( "Get object" ). What data type is the retreived value? Do I maybe have to convert it to an integer before?

    Regards, padawan

  8. #8
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Get parameter from an external text file

    Ah... "Fixed" is something completely different! You should use much the same method as you did to get the data out of the Get object and into the String, but convert it to a value along the way:

    Set X scale to Val(Received$("Get Object"))

    I can't remember if the expression for whatever's been retrieved is Received$ or something else... still, you get the idea.

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Oct 2010
    Location
    Hamburg / Germany
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Get parameter from an external text file

    Yes!! That was the solution, indeed. I mistook the Expression Fixed() for an absolute scaling in this case. With Set X scale to Val(Received$("Get Object")) it works perfect. Thanks a lot for all your efforts! Now I can go on experimenting with this setup.

    [EDIT]
    Oh, folks, this is great! I´m just having a great time playing around with the Get Object :eek:
    [/EDIT]

    Regards, padawan

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Sparckman's Avatar
    Join Date
    Feb 2011
    Location
    Planet of the Kangaroos
    Posts
    1,423
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Here is another way to retrieve values from an external source or just plain text
    http://community.clickteam.com/threads/87236-Display-text-from-external-source

Similar Threads

  1. Delete external file AND check if file exists
    By Renatos in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 16th August 2011, 03:39 PM
  2. Loading an External Text in an Edit File
    By spiderjjr45 in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 7th February 2010, 02:32 AM
  3. To launch a file html or external file
    By daniele in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 29th July 2009, 07:39 PM
  4. Second Parameter in Button Text$
    By RickyRombo in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 23rd May 2009, 03:22 AM

Posting Permissions

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