Lower third Text scrolling

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Lower third Text scrolling

Post by Klaus » Sat Oct 14, 2017 2:39 pm

@proloy

OK, if you are using LC <= 7 then this should do:

Code: Select all

on mouseUp
   repeat with x = 1 to number of buttons of grp "Checkboxes"
      if the hilite of btn x of grp "Checkboxes" then
         put the label of btn x of grp "Checkboxes" & cr after mylist
         
         ## Sure you don't mean something like this:
         ## put line x of fld "News" & CR after mylist
         ## ??? Since you mentioned "editing text".
      end if
   end repeat
   set the text of fld "Lower" to mylist
end mouseUp
Best

Klaus

P.S.
You mentioned an attachment, but there is none.

proloy
Posts: 19
Joined: Thu Aug 17, 2017 9:07 am

Re: Lower third Text scrolling

Post by proloy » Mon Oct 16, 2017 5:23 am

Dear klaus,
I can't attach file without jpg format. plz download form below.
https://www.dropbox.com/s/l9p6ogboaw6bn ... ecode?dl=0

I am using LC v 8.1.6

Thanks

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Lower third Text scrolling

Post by Klaus » Mon Oct 16, 2017 12:01 pm

Hi proloy,

you need to ZIP the stack(s) before uploading here!

Ich checked your stack, you have grouped some buttons and added a script to the group.
BUT thsi script will never be executed because:
1. You did not add a "trigger", "mouseup" in this case:

Code: Select all

repeat with x = 1 to number of buttons of grp "Checkboxes"
   if the hilite of btn x of grp "Checkboxes" then
      put the short name of btn x of grp "Checkboxes" & cr after myList
   end if
end repeat
put myList into fld Lower
## QUOTES missing here! -> fld "Lower"
2. The buttons in that group DO however have a "mouseup" script, which will get executed
but NOT the script of the group.

Hint:
A clever naming scheme is half the rent!
So since you want to get a line in a field with a click on the corresponding button,
you should do something like this:
a. Name ALL of your buttons with a SPACE:
Check 1
Check 2
etc...
b. Remove the "mouseup" script from every button!
C. Now you can group ALL of your buttons andf add a mouseup script to the group with this script:

Code: Select all

on mouseup
   put the short name of the target into tClickedButton
   ## Extract line number from clicked button name!
   put word 2 of tClickedButton into tTargetLineNumber
   ## Now do something with -> line tLineNumber of fld "News"
   put CR & line tLineNumber of fld "News" after fld ""Lower"
end mouseup
Best

Klaus

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: Lower third Text scrolling

Post by Da_Elf » Mon Oct 16, 2017 12:42 pm

how are you exporting your text to the tv? ive worked with a software for that. i used livecode as only the GUI that talks to the other software via tcp/ip

proloy
Posts: 19
Joined: Thu Aug 17, 2017 9:07 am

Re: Lower third Text scrolling

Post by proloy » Tue Oct 17, 2017 3:44 am

Da_Elf wrote:
Mon Oct 16, 2017 12:42 pm
how are you exporting your text to the tv? ive worked with a software for that. i used livecode as only the GUI that talks to the other software via tcp/ip
Hello Da_Elf,
Same here, are you talking about CasparCG?

proloy
Posts: 19
Joined: Thu Aug 17, 2017 9:07 am

Re: Lower third Text scrolling

Post by proloy » Tue Oct 17, 2017 4:48 am

HI Klaus,
Thanks for reply, i think we are very close to the point.
1. I was forgot to add "mouseUP"
2. Rename all check button.
b. Removed all script from check button.
c. confused

Code: Select all

on mouseup
   put the short name of the target into tClickedButton ---which will be my target?
   ## Extract line number from clicked button name! --- is it "check"?
   put word 2 of tClickedButton into tTargetLineNumber
   ## Now do something with -> line tLineNumber of fld "News" --- what to do?
   put CR & line tLineNumber of fld "News" after fld ""Lower"
end mouseup
I know you may angry on me :cry: but i am learning..
plz consider me and advice..

Thanks.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Lower third Text scrolling

Post by bogs » Tue Oct 17, 2017 5:06 am

proloy wrote:
Tue Oct 17, 2017 4:48 am
...I know you may angry on me...
Klaus ? The man has the patience of a saint
Image
Think I'll start calling him 'SinterKlaus', distributing Lc goodies to girls and boys... :mrgreen:
Image

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: Lower third Text scrolling

Post by Da_Elf » Tue Oct 17, 2017 10:50 am

proloy wrote:
Tue Oct 17, 2017 3:44 am
Hello Da_Elf,
Same here, are you talking about CasparCG?
Indeed i am. Awesome program

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Lower third Text scrolling

Post by Klaus » Tue Oct 17, 2017 11:16 am

Hi proloy,

my fault, sorry!

Code: Select all

on mouseup
   put the short name of the target into tClickedButton ---which will be my target?
   ## Extract line number from clicked button name! --- is it "check"?
   put word 2 of tClickedButton into tTargetLineNumber
   ## put CR & line tLineNumber of fld "News" after fld ""Lower"
   put CR & line tTargetLineNumber of fld "News" after fld "Lower"
end mouseup
See the difference?


Best

Klaus

proloy
Posts: 19
Joined: Thu Aug 17, 2017 9:07 am

Re: Lower third Text scrolling

Post by proloy » Wed Oct 18, 2017 4:43 am

Klaus wrote:
Tue Oct 17, 2017 11:16 am

Code: Select all

on mouseup
   put the short name of the target into tClickedButton
   ## Extract line number from clicked button name!
   put word 2 of tClickedButton into tTargetLineNumber
 end mouseup
Klaus
really i am not clear,
which will be my target: "fld_News", "checkbox_Check", "fld_Lower" or button?
how can i Extract line number? is it:

Code: Select all

put line 1 of field "News" into button "Check 1"
plz advice..
Thanks

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Lower third Text scrolling

Post by Klaus » Wed Oct 18, 2017 1:02 pm

Hi proloy,
proloy wrote:
Wed Oct 18, 2017 4:43 am

Code: Select all

on mouseup
   put the short name of the target into tClickedButton
   ## Extract line number from clicked button name!
   put word 2 of tClickedButton into tTargetLineNumber
 end mouseup
you forgot the last and most important line of my script!

Code: Select all

...
 put CR & line tTargetLineNumber of fld "News" after fld "Lower"
end mouseup
Which should explain pretty well what I am doing here.

This is the script of the GROUP of checkboxes.
the short name of the target
-> Will return the name of the clicked CHECKBOX inside of the group like:
-> Check 2

SO "word 1" of this = Check
"word 2" of this = 2

So now we know the corresponding line number of field "News" that is "related" to that checkbox
and we can take that line from field "News" and do whatever we want to do with it.

Hint: You should really go through these stacks to get the very basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html

Best

Klaus

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Lower third Text scrolling

Post by bogs » Wed Oct 18, 2017 2:59 pm

Klaus wrote:
Wed Oct 18, 2017 1:02 pm
Hint: You should really go through these stacks to get the very basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html
Those are very helpful to read, you *may* also find the "Concepts & Techniques" and "Reference" sections of this stack of help to you to become better aquainted with Lc, it has a pretty good basic examples page and things listed in sections.
Last edited by bogs on Sun Mar 11, 2018 11:36 pm, edited 1 time in total.
Image

proloy
Posts: 19
Joined: Thu Aug 17, 2017 9:07 am

Re: Lower third Text scrolling

Post by proloy » Sun Oct 22, 2017 6:01 am

Code: Select all

on mouseup
   put the button "Check 1" into tClickedButton
   ## Extract line number from clicked button name!
   put word 2 of tClickedButton into tTargetLineNumber
   ## put CR & line tLineNumber of fld "News" after fld ""Lower"
   put CR & line tTargetLineNumber of fld "News" after fld "Lower"
end mouseup
no luck

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Lower third Text scrolling

Post by jmburnod » Sun Oct 22, 2017 11:19 am

Hi proloy,

Code: Select all

...
put the button "Check 1" into tClickedButton
...
return empty without error.
Please, try this as Klaus said:

Code: Select all

...
put the short name of the target into tClickedButton
...
Of course your btn name must have two words and last word must be an integer
Best regards
Jean-Marc
https://alternatic.ch

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”