Weird popup events

FallacyStudiosFallacyStudios Member Posts: 970
edited January 2012 in Working with GS (Mac)
I'm getting some really wrong and odd things happening when I make my popup.

I have a button (Directions). When it is pressed it sets all the alphas of the Popup box, close button, and video button to 1. This works correctly the first time. The Popup box and its buttons are displayed and obviously their alphas are 1. Now the close button turns all those alphas (popup box, close button, video button) to 0 and this only works when it is clicked and its alpha is 1. The video button (when alpha 1) is pressed it opens up a video url. The pop up box (when alpha 1) change attributes the size and position of the box to the center of the screen and at a large size. When the alpha is 0 it sets it off the screen to a small size.

Here is what is happening. I click directions and it opens up everything correctly. I click the close button and it closes everything correctly (so it seems). When I click directions again nothing happens. None of the buttons or the popup box are displayed. If I click on the screen where the video button is (even though it is alpha 0) nothing still happens, but now when directions is pressed it opens up a video. No the buttons are not in the same location... where the video button is displayed is away from where any other buttons are displayed as well. I find this very strange. It is not set to do so, but how is it that the direction buttons actions are some how being changed? It doesn't have anything about opening up a video in it (anymore). And yes I checked everything in that scene (all layers).

Comments

  • FallacyStudiosFallacyStudios Member Posts: 970
    So any ideas?
  • MotherHooseMotherHoose Member Posts: 2,456
    what is triggering the state of the Directions button ?

    just touch wont always work as the computer has already responded to that
    (though touch video forced a recheck/rerun)

    suggest that you use a gameAttribute Index type directionsFlow = 0

    DirectionButton:
    Rule: when (All)
    Attribute: game.directionsFlow = 0
    Event: touch is pressed
    --changeAttribute: game.directionsFlow To: 1

    on the Actors affected by directions: (including closeButton)
    Rule: when
    Attribute: game.directionsFlow = 1
    --changeAttribute: self.Color.Alpha To: 1
    Otherwise:
    --changeAttribute: self.Color.Alpha To: 0

    add on the videoButton:
    Rule: when (All)
    Attribute: game.directionsFlow = 1
    Event: touch is pressed
    --url

    add on the closeButton:
    Rule: when (All)
    Attribute: game.directionsFlow = 1
    Event: touch is pressed
    --changeAttribute: game.directionsFlow To: 0

    this should keep all the instances locked and working from Prototype in memory

    you could also have those 3 actors off-screen till called for and not bother changing Alpha
    have them in the correct X positions … then
    Rule: when
    Attribute: directionsFlow = 1
    changeAttribute: self.Position.Y To: correct Y
    Otherwise:
    changeAttribute: self.Position.Y To: -300

    @};- MH
Sign In or Register to comment.