AS 2 I'm having problems with variables
A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: I'm having problems with variables

  1. #1
    Junior Member
    Join Date
    Aug 2013
    Posts
    6

    I'm having problems with variables

    I think maybe it is a dumb problem , but anyway
    i set the button ,BOTÃO , to :

    on(release){
    day += 25
    }

    and put this on the frame :

    var day = 0
    if (day >= 25)
    {
    BOTÃO._visible = "false"
    }

    but it just don't disappear
    what i should do ?

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    970
    Hi,

    on the button use,
    PHP Code:
    on (release) {
        
    day += 25;
        if (
    day >= 25)
        {
            
    this._visible false;
        }

    on the frame use,
    PHP Code:
    var day 
    ------------------------------------------------------
    or use, on the button
    PHP Code:
    on (release) {
        
    _root.day += 25;

    and on the frame
    PHP Code:
    var day 0;

    onEnterFrame = function ()
    {
        if (
    day >= 25)
        {
            
    BOTÃO._visible false;
            
    delete onEnterFrame;
        }
    }; 
    ------------------------------------------

    or even this, considering the logic of the button,
    PHP Code:
    on (release) {
        
    _root.day += 25;
        
    this._visible false;


  3. #3
    Junior Member
    Join Date
    Aug 2013
    Posts
    6
    Quote Originally Posted by fruitbeard View Post
    Hi,

    on the button use,
    PHP Code:
    on (release) {
        
    day += 25;
        if (
    day >= 25)
        {
            
    this._visible false;
        }

    on the frame use,
    PHP Code:
    var day 
    }[/PHP]
    I tried that one but when i click the button everything in the frame disappear even if a give a command leading to other frame it don't work ... I would use the last one , the button disappear , fine , but when i go out and then come back to the frame it is there again .

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    970
    Hi,

    If you can attach you fla file or create a downloadable link to it.

  5. #5
    Junior Member
    Join Date
    Aug 2013
    Posts
    6
    http://www.mediafire.com/?3jtnyn7zmjef2sa
    Here is the file i used as example , the ideia were like you have some options , after choosing that one you receive a thing and the button disappear so you only couldn't receive two things from the same button .
    (sorry if i made some english mistakes, it isn't my first language )

  6. #6
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    970
    Hi,

    It's CS5, I can not save any lower version

  7. #7
    Junior Member
    Join Date
    Aug 2013
    Posts
    6
    No problem, it worked anyway
    Thanks very much for your help c:

  8. #8
    Junior Member
    Join Date
    Aug 2013
    Posts
    6
    oh sorry to bother you again... It worked on the example but it don't on the original work
    http://www.mediafire.com/?d9dc4at1g6orcns
    would you see what went wrong ? it is on frame 10

  9. #9
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    970
    Hi,

    It was hard to work with being so small and I don't know the language.
    There were a few duplicate frame names and the "preloader" is somewhat odd and it makes reference to scenes when there are none?

    I have taken the music out so as to make it small enough to post, lets hope this is better??

    CS5:

  10. #10
    Junior Member
    Join Date
    Aug 2013
    Posts
    6
    Sorry for that...
    So thank you for helping me , it is working normally now , i'll apply it to the others parts of the game

Posting Permissions

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




Click Here to Expand Forum to Full Width


HTML5 Development Center

Poll by Flashkit.com