• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

using drag and drop to change MovieClip layer's opacity

Community Beginner ,
Jul 28, 2016 Jul 28, 2016

Copy link to clipboard

Copied

Hi all, I am creating a simple game in Animate. I want to be able to pick up(drag and drop) a MovieClip(1) which when moved over another MoviClip(2) will change the opacity of the topmost layer in MovieClip(2). I know I do not explain well.

The game will involve washing dishes or a car. As a graphic of a 'sponge'(clip-1)  is moved over a representation of dirty dishes or a dirty car-bubbles animate from the 'sponge' and depending on how long the 'sponge' is held over the dishes(2)then the opacity of the top layer (which will represent dirt) will drop to reveal a 'clean' layer beneath.

I have seen this exact thing done in the app my boo where the creature is washed with a sponge.

myBoo.jpg

Thanks in advance guys.

Peace - John

Views

830

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 29, 2016 Jul 29, 2016

Copy link to clipboard

Copied

What is your target? ActionScript or HTML5?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 08, 2016 Aug 08, 2016

Copy link to clipboard

Copied

Hi Sinious, My target is ActionScript3.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 08, 2016 Aug 08, 2016

Copy link to clipboard

Copied

I have posted the same question in the animate forum (I hope that this is not bad form).

A member there says that I could do this with hit test. Do you think this is probably the way to go? I have been reading thathit test will still detect a layer when it's opacity is zero.

Thanks again for all the help Sinious.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 11, 2016 Aug 11, 2016

Copy link to clipboard

Copied

LATEST

This is where I am Sinious.

I have a MovieClip1(sponge) and MovieClip2(dirtydishes). I have used the Touch_begin and Touch_end events so I can drag MovieClip1 around the screen. I stored it's original position so when I let go it returns to it's original point. Works great.

I need for MoviClip1 to check whether it has passed over MovieClip2.

I have tried placing HitTest in both the Touch_begin and Touch_end functions and run a trace. MovieClip1 only checks for a hit test when I first drag it or when I drop it, registering no collision.

Is there a way of getting MovieClip1 to check for a HitTest as it passes over MovieClip2.

Thanks in advance

Peace

John

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines