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

Onclick event help

New Here ,
Apr 29, 2012 Apr 29, 2012

Copy link to clipboard

Copied

Hi,

How should i code a onclick event to activate something on the timeline?

So basiclly when the user clicks something, i want the time line to play what i have put in there

Any info would be great thanks

TOPICS
ActionScript

Views

910

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 ,
Apr 29, 2012 Apr 29, 2012

Copy link to clipboard

Copied

something.addEventListener(MouseEvent.CLICK, activateSomething);

function activateSomething(evt:MouseEvent):void {

     // whatever you mean by play what you have put in the timeline

}

where "Something" is the instance name of the thing you click

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
New Here ,
Apr 30, 2012 Apr 30, 2012

Copy link to clipboard

Copied

Is there a way to put in an action on the start of the time to say, dont start this till the user clicks this?

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
LEGEND ,
Apr 30, 2012 Apr 30, 2012

Copy link to clipboard

Copied

That is what that code does.

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
New Here ,
Apr 30, 2012 Apr 30, 2012

Copy link to clipboard

Copied

It didnt work, i must be doing something wrong, the timeline still plays even when i put the code in.......my timeline is 48 frames long and its a motion tween and i have created a second lay to put the code in because i cant put it in the layer with the motion in it.

All i have is a block which scrinks, called Bcard and i just want it to shrink when the user clicks on it. I put your code into the second layer action but the motion still play before the user clicks it......

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
LEGEND ,
Apr 30, 2012 Apr 30, 2012

Copy link to clipboard

Copied

Have you tried putting a stop(); command in the timeline to keep it from moving?

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
New Here ,
May 01, 2012 May 01, 2012

Copy link to clipboard

Copied

Yea i did....But the clip stops and when i click on the instance it doesnt play the timeline/

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
LEGEND ,
May 01, 2012 May 01, 2012

Copy link to clipboard

Copied

Up to this point you haven't shown any code at all. Show what code you are using and maybe someone can help.

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
New Here ,
May 01, 2012 May 01, 2012

Copy link to clipboard

Copied

This is the first time i am implementing coding into the action.

I will try and explain it abit better.

I have a image which is a card, i turned it into a motion tween and in the 24 frames all it does is shrinks in size but i do not want it to shrink untill the user clicks on the card. Thats all i am trying to do.

Thank you

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
LEGEND ,
May 01, 2012 May 01, 2012

Copy link to clipboard

Copied

LATEST

Up to this point you haven't shown any code at all. Show what code you are using and maybe someone can help.

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