Old 26th March 2003, 15:34   #1
carlosp
Major Dude
 
carlosp's Avatar
 
Join Date: Nov 2002
Location: Hamburg, Germany
Posts: 1,312
need help for a good script idea ?

Hello everyone,
I have another problem agian. Well my applying is:
I working on a new skin and i want to have a bilnking text when i press on pause button. is that possible??
I tryed to make one but it deosn´t work and i think it is coded wrong. I wrote this shit

System.onPause();
PauseTimer.start();
Songticker.setAlternateText("Pause");
Songticker.setAlpha(0);
PauseTimer.setDelay(50);
Songticker.setAlternateText("Pause");
Songticker.setAlpha(255);

System.onResume();
PauseTimer.stop();

I am a newbie at coding and i think some of you well laught about this code.
carlosp is offline   Reply With Quote
Old 26th March 2003, 17:42   #2
frisbeemonkey
Major Dude
 
frisbeemonkey's Avatar
 
Join Date: Jun 2002
Posts: 851
You can't change the alpha of Text that way. What you need to do have a layer over top that you fade in and out instead.
Second, you're code structure is all out of whack. onPause() and onResume() should have brackets "{}" to contain the code you want to run when those events happen. For example, your second function should look like:
System.onResume() {
PauseTimer.stop();
}
Third, Timers don't work how you are trying to use them. You'll want to use PauseTimer.onTimer() to control your fading in and out.

Hope this helps a bit,
~FrisbeeMonkey
frisbeemonkey is offline   Reply With Quote
Old 26th March 2003, 21:24   #3
carlosp
Major Dude
 
carlosp's Avatar
 
Join Date: Nov 2002
Location: Hamburg, Germany
Posts: 1,312
Yes, thanks.
carlosp is offline   Reply With Quote
Old 27th March 2003, 16:04   #4
Digitalhigh
Senior Member
 
Digitalhigh's Avatar
 
Join Date: Aug 2002
Location: hell
Posts: 232
You'd think I'd be using this time to work on my own stuff, but helping seems like sooo much more fun. U don't necessicarily have to use the attached script, but I whipped one up for you to see how it should look...

It even compiles.
Attached Files
File Type: m blinkpause.m (818 Bytes, 134 views)
Digitalhigh is offline   Reply With Quote
Old 27th March 2003, 16:58   #5
carlosp
Major Dude
 
carlosp's Avatar
 
Join Date: Nov 2002
Location: Hamburg, Germany
Posts: 1,312
Thanks a lot jimmy

Here is one other quastion for U:

I wrote this script and every time i press on my button winamp crashed down. Can you say me why???

#include "../../../lib/std.mi"
#include "../../../lib/config.mi"


Function setTempText(String txt);
Function emptyTempText();
Function setSuperText(String txt);

Class ToggleButton HintToggleButton;
Class ConfigAttribute ToggleConfigAttribute;


Global HintToggleButton ToggleXFade, ToggleShuffle, ToggleRepeat;
Global ToggleConfigAttribute attr_repeat, attr_shuffle, attr_crossfade;
Global Container MainContainer;
Global Layout layoutNormal;
Global Group displayGroup ;

System.onScriptLoaded() {
//Main Layout
MainContainer= getContainer("main");
layoutNormal=MainContainer.getLayout("normal");

displayGroup = layoutNormal.getObject("player.main.buttons");



ToggleXFade = displayGroup.getObject("Crossfade");
ToggleShuffle = displayGroup.getObject("Shuffle");
ToggleRepeat = displayGroup.getObject("Repeat");

if (ToggleXFade != NULL && attr_crossfade != NULL) ToggleXFade.setActivated(StringToInteger(attr_crossfade.getData()));
if (ToggleShuffle != NULL && attr_shuffle != NULL) ToggleShuffle.setActivated(StringToInteger(attr_shuffle.getData()));
if (ToggleRepeat != NULL && attr_repeat != NULL) ToggleRepeat.setActivated(StringToInteger(attr_repeat.getData()));

}

HintToggleButton.onLeftButtonDown(int x, int y) {
if (HintToggleButton == ToggleXFade) setSuperText("Crossfade");
else if (HintToggleButton == ToggleRepeat) setSuperText("Repeat");
else if (HintToggleButton == ToggleShuffle) setSuperText("Shuffle");
}

HintToggleButton.onToggle(int onoff) {
String cmd, txt;
txt="none";
if (HintToggleButton == ToggleXFade) {
txt = "Crossfade";
} else if (HintToggleButton == ToggleRepeat) {
txt = "Repeat";
} else if (HintToggleButton == ToggleShuffle) {
txt = "Shuffle";
}
if (txt != "none") {
String s;
if (onoff) s = "on"; else s = "off";
setSuperText(txt + " now " + s);
}
}


Thanx a lot.
carlosp is offline   Reply With Quote
Old 27th March 2003, 17:39   #6
Digitalhigh
Senior Member
 
Digitalhigh's Avatar
 
Join Date: Aug 2002
Location: hell
Posts: 232
Allright, this is a bit hard to test without the skin it goes with, but I think I found the problem. It looks like your function SetSuperText(string txt) is defined at the top but never instantiated anywhere in the code. So, I added the line at the bottom, as well as a text object for the songticker called songticker. You still need to tell winamp where that ticker is. You should also consider adding a function and timer to clear the songticker after a certain period of time.
Attached Files
File Type: m newfixedtext.m (2.0 KB, 167 views)
Digitalhigh is offline   Reply With Quote
Old 27th March 2003, 18:52   #7
carlosp
Major Dude
 
carlosp's Avatar
 
Join Date: Nov 2002
Location: Hamburg, Germany
Posts: 1,312
Thanx a lot. You rule jimmysmith

ps.[music] sweeeett home alaaabaama....[music/]
carlosp is offline   Reply With Quote
Old 27th March 2003, 19:01   #8
Digitalhigh
Senior Member
 
Digitalhigh's Avatar
 
Join Date: Aug 2002
Location: hell
Posts: 232
Glad to help.

[music] Well Jimmy lives in a trailer...[/music]
Digitalhigh is offline   Reply With Quote
Old 28th March 2003, 17:03   #9
carlosp
Major Dude
 
carlosp's Avatar
 
Join Date: Nov 2002
Location: Hamburg, Germany
Posts: 1,312
ok one other q. !

[B]How can i say winamp to set desktopalpha on when my skin is loaded?[/]


// never forget to include std.mi
#include "../../../lib/std.mi"
#include "../../../lib/config.mi"

//declares global variables for use in script
Class ConfigAttribute ToggleConfigAttribute;

Global Container MainContainer;
Global Layout layoutNormal;
Global ToggleConfigAttribute attr_desktopalpha;

//when the script is loaded, do this
System.onScriptLoaded() {

//Main Layout
MainContainer= getContainer("main");
layoutNormal=MainContainer.getLayout("normal");

ConfigItem item = Config.getItem("Skins and UI Tweaks");
if (item != NULL) {
attr_desktopalpha = item.getAttribute("Enable desktop alpha");
}

if (StringToInteger(attr_desktopalpha.getData()) != 1) {
layoutNormal.show(); }
else if (StringToInteger(attr_desktopalpha.getData()) != 0){
layoutNormal.hide();

}

}



Could you download my new Skin skin (mk deadly allinace) and look at it.You´ll we see the bug in the script if press on the LCD-Buttons. Could look at the main.m and try to find the bug?

Thanx a lot.
carlosp is offline   Reply With Quote
Old 28th March 2003, 21:08   #10
J_Bloggs
Major Dude
 
J_Bloggs's Avatar
 
Join Date: Jan 2002
Posts: 1,778
I'm sure it would be possible, but I wouldn't suggest it. People may have DTA turned off for a reason.

¯¯¯¯Joe Bloggs____
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
J_Bloggs is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Skinning and Design > Modern Skins

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump