Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
If/Else Events Alice 2.4.1
Old
Sgat8516
Junior Member
 
Status: Offline
Posts: 1
Join Date: Apr 2014
Default If/Else Events Alice 2.4.1 - 04-14-2014, 08:47 AM

Quote:
I'm currently in a class using this version of Alice, and one of the assignments is to modify a world with 3 buttons; each button should toggle up+down with keystrokes from an event; and while each button is depressed it should play an audio file.
The starting world has an if/else statement in Events, with a boolean variable attached to the object inside (which I couldn't figure out how to duplicate, until I made the if/else statement inside of a function for that object, dragged the boolean over, ignoring recursive error, and then dragging the if/else into the events tab). That one toggles up+down correctly, and I did figure out how to duplicate that.
The problem that still alludes me, is toggling an audio file only while the button is depressed. The initial startup world's example audio file does not work, as it has a variable for the object as the condition (which I cant duplicate, only a world variable seems to work in this location as i cant drag the function to the object to copy over).
But when I setup a world variable for that function, and add it to the method's (an existing method that toggles the boolean inside the up+down function; added the world variable inside those as well so it toggles both on depressing) the audio file does not play. Tried multiple variations, but none seem to have an effect. The only way to get the audio file to play from events, is to add the method containing it (or just the play sound from object). When doing that, the audio file plays the entire track and then terminates, the instructions were to have the file loop until the button was raised again.

Any help? Can provide the worlds if needed.
Cancel that question... Apparently its the version of Alice I'm using (2.4.1). In whatever version the school is using the audio toggle works just fine.

Last edited by Sgat8516; 04-14-2014 at 01:38 PM. Reason: Found solution
   
Reply With Quote
Reply

Thread Tools
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



Copyright ©2018, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.