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

Can you use actionscript to detect if an icon has been clicked in your Flash Website?

Participant ,
Mar 28, 2013 Mar 28, 2013

Copy link to clipboard

Copied

I want to make my icons glow, or pulsate, if they have not been clicked.  If the viewer clicks on the icon, they will watch a video clip, and then be sent back to the main screen with the pulsating icons.  Is it possible for Flash to detect if that icon has been clicked when returning to the main screen so the icon they clicked can stop pulsating?

?  I am certain it is not possible with the timeline.  Any help would be appreciated as always

TOPICS
ActionScript

Views

1.4K

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

correct answers 1 Correct answer

Community Expert , Mar 28, 2013 Mar 28, 2013

that setup is problematic.  use a one frame swf that contains your icon movieclips, only.  assign the icon movieclips instance names like icon1_mc, icon2_mc etc.  add an flvplayback component to your library.

you can then use:

var flv_pb:FLVPlayBack=new FLVPlayBack();

flv_pb.addEventListener(Event.COMPLETE,completeF);

function completeF(e:Event):void{

removeChild(flv_pb);

}

var gf:GlowFilter=new GlowFilter();

var previouslyClickedIcon:MovieClip;

var iconA:Array=[icon1_mc, icon2_mc, etc..];

var flvA:Array=

...

Votes

Translate

Translate
Community Expert ,
Mar 28, 2013 Mar 28, 2013

Copy link to clipboard

Copied

what's the relationship between your swf and the icons?

are the icons in the swf?  are the icons outside the swf but in the same html page as the swf?

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
Participant ,
Mar 28, 2013 Mar 28, 2013

Copy link to clipboard

Copied

The icons are essentially buttons that move to another frame and play a video.  They are all in the same exported swf

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 Expert ,
Mar 28, 2013 Mar 28, 2013

Copy link to clipboard

Copied

convert your icons to movieclips, add mouse listeners and apply a glow filter (animate the filter if you want it to pulsate) to a clicked icon and unapply the filter to the previously clicked icon movieclip (if there is one) in your listener function.

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
Participant ,
Mar 28, 2013 Mar 28, 2013

Copy link to clipboard

Copied

I should rephrase this I suppose.  I know how to do mouse over and click events.  I know how to animate movie clip buttons.  Let me try to explain this better since I screwed it up the first time pretty badly. 

Say the main area is in frame one.  This includes all the movie clip buttons (say 4 of them).  On frames 2-5, there are brief videos that play through an FLV player.  On the initial visit to Frame 1, the user clicks on one of the buttons to take them to, say, frame 3.  Once the movie completes, the user is then put back to frame 1 again.  Is it then possible to have the frame 3 button no longer glow or pulsate, but still work as a button?  I want my user to know where they have already been on my site, and I am not sure this is possible

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 Expert ,
Mar 28, 2013 Mar 28, 2013

Copy link to clipboard

Copied

that setup is problematic.  use a one frame swf that contains your icon movieclips, only.  assign the icon movieclips instance names like icon1_mc, icon2_mc etc.  add an flvplayback component to your library.

you can then use:

var flv_pb:FLVPlayBack=new FLVPlayBack();

flv_pb.addEventListener(Event.COMPLETE,completeF);

function completeF(e:Event):void{

removeChild(flv_pb);

}

var gf:GlowFilter=new GlowFilter();

var previouslyClickedIcon:MovieClip;

var iconA:Array=[icon1_mc, icon2_mc, etc..];

var flvA:Array=["flv associated with icon1.flv", "icon2.flv", etc..];

for(var i:int=0;i<iconA.length;i++){

iconA.addEventListener(MouseEvent.CLICK,clickF);

}

function clickF(e:MouseEvent):void{

if(previouslyClickedIcon){

previouselyClickedIcon.filters=[];

}

MovieClip(e.currentTarget).filters=[gf];

addChild(flv_pb);

//position flv_pb

flv_pb.source = flvA[iconA.indexOf(e.currentTarget)];

}

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
Participant ,
Mar 28, 2013 Mar 28, 2013

Copy link to clipboard

Copied

This may do it.  But I may be over my head.  How would use an imported swf to control my main timeline?  I apologize for being so ignorant in flash and as3

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 Expert ,
Mar 28, 2013 Mar 28, 2013

Copy link to clipboard

Copied

what are you trying to do?

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
Participant ,
Mar 28, 2013 Mar 28, 2013

Copy link to clipboard

Copied

I am trying to make an exploratory web page in flash.  Basically, I want to draw the attention to icons/ buttons that have not been clicked before.  If they have been clicked, I still want them to be there, but not glowing or whatever.  The only way I know how to make multiple FLV files available to play is by putting them on different frames.  I am in school and can not afford a streaming service.  I am not sure if what I want to do is even possible.  I am also finding bug after bug in CS 6 as compared to CS 5

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
Participant ,
Mar 28, 2013 Mar 28, 2013

Copy link to clipboard

Copied

I really need to learn AS3 properly.  I am trying to do what I can with whay I know, but I am not a programmer

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 Expert ,
Mar 28, 2013 Mar 28, 2013

Copy link to clipboard

Copied

then start coding/working on your project.

if you run into a problem you can't solve on your own, post in this forum.

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
Participant ,
Mar 28, 2013 Mar 28, 2013

Copy link to clipboard

Copied

Thanks.  Usually I just take my time and look up what I am trying to do.  This time, I have a deadline for school and I want to blow my professors away.  That is why I am asking these types of questions in here.  I have been working on my project and have a working prototype up, but I would like to be able to add the features that make it special.  Thanks for all your 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
Community Expert ,
Mar 28, 2013 Mar 28, 2013

Copy link to clipboard

Copied

LATEST

you're welcome.

p.s. this is the part of the code that adds and removes the glow filter: 

var gf:GlowFilter=new GlowFilter();

var previouslyClickedIcon:MovieClip;

function clickF(e:MouseEvent):void{

if(previouslyClickedIcon){

previouselyClickedIcon.filters=[];

}

MovieClip(e.currentTarget).filters=[gf];

// add your navigation code here.

}

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