A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Actionscript for alpha within a movie (CS4)

  1. #1
    Junior Member
    Join Date
    Dec 2015
    Posts
    5

    Actionscript for alpha within a movie (CS4)

    Hi,

    Thanks for any help anyone can give me as I'm struggling with this.

    I have used a movie from here which is a Christmas game that I was hoping to slightly change before I used.

    Within a movie clip I have put in the 1st key frame a random number generator which puts a number in a dynamic text box.

    I have 7 different facial pictures that are stuck on a Santa body and they all have their alpha set to 0, they are changed by the dynamic text box that when a number is generated it changes the alpha to 100 for the picture it is linked to and the other 6 pictures stay on 0 alpha.

    When I test the scene, one number is generated and the one pictures alpha changes to 100 and the Santa walks across the screen and it all works perfectly, however when I go into the parent movie and test it the Santa walks across the screen with all the pictures alpha's set to 100.

    Any ideas as to what I'm doing wrong please?

    This was supposed to be a quick bit of fun that has now taken up way to much of my time !

    Thanks,

    Matt

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

    Attach your *.fla , let's have a look at it.

  3. #3
    Junior Member
    Join Date
    Dec 2015
    Posts
    5
    Hi,

    I cant attach it as its 603kb compressed and it says it has to be under 300kb.

    Am I missing something, is there an alternative way to upload the fla ???

    Thanks

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

    It's probably due to the way in which you are setting the alpha of the clips.

    Example. outsideClip.insideclip._alpha = 25; when testing from outside

    when testing from insideclip that code wont wont as outsideclip does not exist

    maybe use code such as

    if(outsideclip)
    {
    outsideclip.insideclip._alpha = 25;
    }
    else
    {
    insideclip._alpha = 25;
    }

    that will just make it work from in or out, it checks if outsideclip exists first.

    Hope that makes some sense to you

    yopu can always upload your file to some free file server or create a skeleton file/s to upload here.

  5. #5
    Junior Member
    Join Date
    Dec 2015
    Posts
    5
    Hi,

    Thank you very much for your help.

    I have put the .fla on google drive (link below).

    I hope that's ok as I want to know how it should be done properly.

    https://drive.google.com/file/d/0B0I...ew?usp=sharing

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

    Sorry, it's Actionscript 1 and I forgot how to even read it.
    Are you sure all files are there too as it just keeps outputting Target not found: Target=""/snow"&/:snowcount" Base="_level0.instance4"

  7. #7
    Junior Member
    Join Date
    Dec 2015
    Posts
    5
    Unfortunately it was created in action script 1, I used it thinking it would be quite quick and easy to amend and use for a bit of fun, think I've learnt a lesson there !

    I read the error message that it was a fault in the snow flakes but wasn't really bothered about it as they were working ok.

    Would the code you gave me before not work with action script 1 ?

    I do appreciate the help your giving me, thank you

  8. #8
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    HI,

    It's almost certainly a path issue when it works from within and not from out of parent ect ect.

    All the basic gudide code I gave was to test if it was inside the parent and if not then alter the code path to target the same clip.

    it should work but you will need to test

  9. #9
    Junior Member
    Join Date
    Dec 2015
    Posts
    5
    Thanks fruitbeard,

    Unfortunately I cant get it to work so I may have to think of a plan B !

    Thanks for all your help and advise.

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