Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2009
    Posts
    30

    Grin Help with text effect function.

    Hello guys,

    I'm new on this forum but I have some basic skills with AMS. Now i'm using AMS 7.5 and I'm trying to find a way to solve a very simple problem with this function, that add a typing effect to the text:

    Code:
    function efeitotexto ()
    cont = 0
    texto = Paragraph.GetText("Paragraph1");
    menssagem = "Any message here"
    total = String.Length(message);
    for cont = 0, total do 
    escrever = String.Left(menssagem, cont);
    Paragraph.SetText("Paragraph1", escrever);
    Application.Sleep(120); 
    end
    end
    Is there any other way to pause the script for a short time instead of using application.sleep? like, i want the delay time but without freezing the application. I attached my project here. Please help.

    Sorry my english.

    Gladius
    Last edited by gladius; 02-09-2009 at 11:50 AM.

  2. #2
    Join Date
    Jul 2002
    Location
    Just South of Reality
    Posts
    778
    One way would be to use the page timer to accomplish this.
    Place your code for the message On Show then place your loop within the page timer script. Place the code that you have in the function ON show as well. The button would then start the page timer, instead of calling the function.

    If you need the page timer for other things also, you can make each code structure dependent on a switch that you can turn on/off; or you can search the forum for multiple-timer options/offerings.

    An example in your apz with a dependancy switch, the On Timer code could be:
    Code:
    if delaySw == 1 then
    	if cont < total+1 then
    		escrever = String.Left(message, cont);
    		Paragraph.SetText("Paragraph1", escrever);
    		cont=cont + 1
    	end
    end
    with the Page.StartTimer(120).
    To stop the text effect, you may turn off the delaySw or set cont > total...

    I hope that gives you some idea.

    P.S. Welcome to the forum.
    Last edited by holtgrewe; 02-08-2009 at 12:45 PM.

  3. #3
    Join Date
    Feb 2009
    Posts
    30

    Huh? Not Working

    Hello guys,

    Thank you for the help holtgrewe but this is not working (Am I doing something wrong?). Below is my code ( I changed some things):

    On show
    Code:
    -- function for the text effect
    function efeitotexto ()
    -- counter
    cont = 0
    -- string that hold the message for the paragraph1
    texto = Paragraph.GetText("Paragraph1");
    message = "Any message here"
    total = String.Length(message);
    end

    On Timer
    Code:
    delaySw = 1
    efeitotexto()
    if delaySw == 1 then
       if cont < total+1 then
          for cont = 0, total do 
               escrever = String.Left(message, cont);
               Paragraph.SetText("Paragraph1", escrever);
               cont=cont + 1
    	   end
    	end
    end

    Plugin2
    Code:
    Page.StartTimer(120)

    I attached the program if you guys want to take a look.


    Gladius
    Last edited by gladius; 02-09-2009 at 11:50 AM.

  4. #4
    Join Date
    Aug 2003
    Posts
    2,427
    Did you mean that your application stops responding? Try -

    In preload -
    Code:
    message = "Mamae te amo\r\n\r\nvoce é a melhor mae do mundo\r\n\r\n beijos, murillo S2"
    total = String.Length(message);
    cont=0
    -- Not the place that I would normally put functions.
    function efeitotexto ()
    escrever = String.Left(message, cont);
    Paragraph.SetText("Paragraph1", escrever);
    cont=cont+1
    if cont==total then
    Page.StopTimer()
    cont = 0
    end;
    end;
    In page timer -
    Code:
    efeitotexto ()
    In the button on click -
    Code:
    Paragraph.SetText("Paragraph1", "");
    cont=0
    Page.StartTimer(100

  5. #5
    Join Date
    Feb 2009
    Posts
    30

    Thank you

    Thank you longedge, now its working the way I wanted (without freezing the program while showing the message).

    Below I attached the program done for those who want it!

    Thanks again guys for all the help!


    Gladius
    Attached Files

Similar Threads

  1. Resize all buttons and text for different screen resolutions
    By p-rposters in forum AutoPlay Media Studio 6.0
    Replies: 2
    Last Post: 02-19-2008, 03:32 PM
  2. help with ftp connect
    By CAI in forum AutoPlay Media Studio 6.0
    Replies: 0
    Last Post: 09-29-2005, 07:13 PM
  3. Another tough one... Interaction between Web and AMS
    By Agent Jones in forum AutoPlay Media Studio 5.0
    Replies: 13
    Last Post: 08-18-2005, 02:10 PM
  4. Example: Loading Paragraph Text Using a Timer
    By Jonas DK in forum AutoPlay Media Studio 5.0 Examples
    Replies: 7
    Last Post: 11-25-2004, 05:10 PM
  5. HOWTO: Display Conditional Text Based Upon a List Box Selection
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-15-2002, 10:54 AM

Tags for this Thread

Posting Permissions

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