A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: [F8] Flash is lying to me!

  1. #1
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693

    [F8] Flash is lying to me!

    alright, so I'm working on this game I've been trying to make forever. Its a shooter, and after each level you go to inventory/shop screen. Once it goes to the inventory screen and then back to the main game screen my statbar gets messed up. It will continue to display life correctly, it continues to display player's score correctly, but when the user changes weapons it does not show which weapon is now being used. Prior to going to the inventory screen it would show the correct weapon being used. The whole stat bar is an mc with MC's inside of it. When I trace the statBar.pBulletHolder.img._currentframe it says it is displaying the proper image, but low and behold, on the screen it is not displaying the proper image. if anyone is willing to take a look I might love you long time, unless you don't want me to. Sorry if this is really abstract more details can be provided, just wasnt sure what would help.

    -ChaseNYC
    mmm signature

  2. #2
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    first off your description is not abstract enough

    2. did you perhaps used _visible, or _alpha ? somehwere in your code? or is there a mask that doesn´t cover that part?

  3. #3
    Patron Saint of Beatings WilloughbyJackson's Avatar
    Join Date
    Nov 2000
    Location
    Ro-cha-cha-cha, New York
    Posts
    1,988
    A random stab in the dark:

    A) I've noticed in Flash 8, if you have a mask which is a vector graphic or group, and dynamic/animated content (by code) below said mask, sometimes, it does not refresh.

    Solution: Turn the mask into a movie clip.

    Of course, more details on how the structure is set up would be better. (I.E. Like where the code is in relation to the movie clip, if there are more clips named the same thing, etc...)

  4. #4
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693
    when it goes to the second frame I have statBar._visible = false; when it goes back to frame one i made sure to tell it to become visible again. I presume that can't be the problem because why would statbar be visible, as well as 2 of the 3 mcs on it working properly while one of the mcs in it be visible but not displaying the correct frame?

    edit: there are no masks involved.

    the way it is set up is this is all in a MC called Game, the first frame is the game, second is the inventory/shop

    is there anyway to check if there are multiple things running with the same instance name?
    Last edited by ChaseNYC; 02-02-2007 at 11:16 PM.
    mmm signature

  5. #5
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    is there anyway to check if there are multiple things running with the same instance name?
    strl+shift+enter
    will give you the debug mode and should list all instance & variable names

  6. #6
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693
    okay. T_T my first game is turning into a nightmare, I thought I was cut out for this but it seems like I am losing this battle... I found this when I clicked Debug->List Objects:

    Code:
        Movie Clip: Frame=1 Target="_level0.Game.statBar"
          Shape:
          Movie Clip: Frame=1 Target="_level0.Game.statBar.instance207"
            Shape:
          Movie Clip: Frame=3 Target="_level0.Game.statBar.pCurLife" Label="Red"
            Shape:
          Movie Clip: Frame=1 Target="_level0.Game.statBar.pBulletHolder"
            Shape: Mask
            Shape:
            Movie Clip: Frame=1 Target="_level0.Game.statBar.pBulletHolder.img" Label=".40mm"
              Movie Clip: Frame=1 Target="_level0.Game.statBar.pBulletHolder.img.img"
                Shape:
              Movie Clip: Frame=1 Target="_level0.Game.statBar.pBulletHolder.img.instance208"
              Movie Clip: Frame=1 Target="_level0.Game.statBar.pBulletHolder.img.instance209"
            Shape:
            Edit Text: Target="_level0.Game.statBar.pBulletHolder.txtWeapName" Variable= Visible=true Text = .40mm"
          Movie Clip: Frame=1 Target="_level0.Game.statBar.pMaxLife"
            Shape:
            Text:
          Movie Clip: Frame=1 Target="_level0.Game.statBar.scoreHolder"
            Shape:
            Edit Text: Target="_level0.Game.statBar.scoreHolder.txtScore" Variable= Visible=true Text = Score: 1700"
            Shape:
          Movie Clip: Frame=1 Target="_level0.Game.statBar.instance210"
        Movie Clip: Frame=1 Target="_level0.Game.statBar"
          Shape:
          Movie Clip: Frame=1 Target="_level0.Game.statBar.instance5"
            Shape:
          Movie Clip: Frame=3 Target="_level0.Game.statBar.pCurLife" Label="Red"
            Shape:
          Movie Clip: Frame=1 Target="_level0.Game.statBar.pBulletHolder"
            Shape: Mask
            Shape:
            Movie Clip: Frame=3 Target="_level0.Game.statBar.pBulletHolder.img" Label=".60mm"
              Movie Clip: Frame=1 Target="_level0.Game.statBar.pBulletHolder.img.img"
                Shape:
              Movie Clip: Frame=1 Target="_level0.Game.statBar.pBulletHolder.img.instance245"
            Shape:
            Edit Text: Target="_level0.Game.statBar.pBulletHolder.txtWeapName" Variable= Visible=true Text = .60mm"
          Movie Clip: Frame=1 Target="_level0.Game.statBar.pMaxLife"
            Shape:
            Text:
          Movie Clip: Frame=1 Target="_level0.Game.statBar.scoreHolder"
            Shape:
            Edit Text: Target="_level0.Game.statBar.scoreHolder.txtScore" Variable= Visible=true Text = Score: 1700"
            Shape:
          Movie Clip: Frame=1 Target="_level0.Game.statBar.instance8"
    so it seems there are two instances, now I don't see why, there is no code anywhere saying to attach this movie clip, duplicate it or anything of the sort...

    edit: okay, so I put a removeMovieClip in, now it works but still why were there two? i never asked for two, or should I say coded to make a second one...
    Last edited by ChaseNYC; 02-02-2007 at 11:46 PM.
    mmm signature

  7. #7
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    If you use swapDepths() on author time content, and then return to the frame where it was first placed on stage it creates another instance ( As soon as you give author time content a depth > 0 Flash automatically treats it as attached data, so returning to the frame and doing it again makes Flash re-create the image without removing the original ).

    Squize.

  8. #8
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693
    Thanks squize. Was hoping someone would explain why it was happening, even though the problem had been resolved.

    ChaseNYC
    mmm signature

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