[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

12/04/2008 at 08:36AM PST, ID: 23957306
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

AS3  - How to Communicate Between Classes

Tags:

ActionScript 3.0, FireFox/IE/Safari, http://www.tayimagery.com

I can write custom classes, but only know how to create functions within those classes that affect instances of the symbol to which the class is linked. Here's an example:

My class for a gallery thumbnail includes functions for rolling over and off the thumbnail (causing an animation of the thumbnail itself). This class is attached.As you can see, I only know how to talk to "this" - not another movie clip (one that' defined by a different class or code on the timeline).

I can certainly add a click listener to the class, but I don't know what to write in the function in order to tell my separate movie clip of the full-size images to go to the image corresponding to the selected thumbnail. Consequently, I have to instead create a separate instance name for that thumbnail in the FLA timeline - where I know how to communicate between clips. The result is having a mc symbol in the library - linked to an AS class, and also on the timeline with a separate instance name listening for CLICK, in order to move the full image clip.

I do not have a document class named, and have some idea that this may be part of my ignorance.  
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
package
{
	import flash.display.*;
	import flash.events.*;
 
	
	public class NewsSub2 extends MovieClip
	{		
				
		public function NewsSub2()
		{
			this.addEventListener(MouseEvent.MOUSE_OVER, over);
			this.addEventListener(MouseEvent.MOUSE_OUT, out);
//want to add this:
this.addEventListener(MouseEvent.CLICK, nav);
			
//now go see the CLICK function below:
 
			this.stop();
			this.buttonMode = true;
		}
		
		
		private function over(event:MouseEvent):void
		{
			if(this.currentFrame == 1)
			{
				this.gotoAndPlay(1);
			}
			
			
			if(this.currentFrame == 10)
			{
				this.gotoAndStop(10);
			}
						
			if(this.currentFrame == 11)
			{
				this.gotoAndPlay(9);
			}
			
			if(this.currentFrame == 12)
			{
				this.gotoAndPlay(8);
			}
			
			if(this.currentFrame == 13)
			{
				this.gotoAndPlay(7);
			}
			if(this.currentFrame == 14)
			{
				this.gotoAndPlay(6);
			}
			if(this.currentFrame == 15)
			{
				this.gotoAndPlay(5);
			}
			if(this.currentFrame == 16)
			{
				this.gotoAndPlay(4);
			}
			if(this.currentFrame == 17)
			{
				this.gotoAndPlay(3);
			}
			if(this.currentFrame == 18)
			{
				this.gotoAndPlay(2);
			}
			if(this.currentFrame == 19)
			{
				this.gotoAndPlay(1);
			}
 
			
		}
		
		private function out(event:MouseEvent):void
		{
			if(this.currentFrame == 1)
			{
				this.gotoAndStop(1);
			}
			if(this.currentFrame == 2)
			{
				this.gotoAndPlay(18);
			}
			if(this.currentFrame == 3)
			{
				this.gotoAndPlay(17);
			}
			if(this.currentFrame == 4)
			{
				this.gotoAndPlay(16);
			}
			if(this.currentFrame == 5)
			{
				this.gotoAndPlay(15);
			}
			if(this.currentFrame == 6)
			{
				this.gotoAndPlay(14);
			}
			if(this.currentFrame == 7)
			{
				this.gotoAndPlay(13);
			}
			if(this.currentFrame == 8)
			{
				this.gotoAndPlay(12);
			}
			if(this.currentFrame == 9)
			{
				this.gotoAndPlay(11);
			}
			
			
						
			if(this.currentFrame == 10)
			{
				this.gotoAndPlay(10);
			}
			
			if(this.currentFrame == 19)
			{
				this.gotoAndStop(1);
			}
			
		}
	
	private function nav(event:MouseEvent):void
		{
			???SEPARATE CLIP???.gotoAndPlay("Selected Thumbnail");
// Naming the separate clip results in RunTime Error 1009 or 1010
		}
		
	}
}
Sign up now to view this solution
Question Stats
Zone: Web Development
Question Asked By: tayimagery
Solution Provided By: shaymus22
Participating Experts: 2
Solution Grade: A
Views: 64
Loading Advertisement...
12/04/08 12:23 PM, ID: 23098978

All comments and solutions are available to Premium Service Members only. Sign-up to view the solution to this question.

Already a member? Login to view this solution.

 
12/04/08 12:49 PM, ID: 23099274

All comments and solutions are available to Premium Service Members only. Sign-up to view the solution to this question.

Already a member? Login to view this solution.

 
12/04/08 01:41 PM, ID: 23099785

All comments and solutions are available to Premium Service Members only. Sign-up to view the solution to this question.

Already a member? Login to view this solution.

 
12/04/08 01:42 PM, ID: 23099797

All comments and solutions are available to Premium Service Members only. Sign-up to view the solution to this question.

Already a member? Login to view this solution.

 
12/04/08 02:38 PM, ID: 23100280

All comments and solutions are available to Premium Service Members only. Sign-up to view the solution to this question.

Already a member? Login to view this solution.

 
12/04/08 03:19 PM, ID: 23100645

All comments and solutions are available to Premium Service Members only. Sign-up to view the solution to this question.

Already a member? Login to view this solution.

 
12/10/08 06:22 PM, ID: 23145196

All comments and solutions are available to Premium Service Members only. Sign-up to view the solution to this question.

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080206-EE-VQP-25 - Hierarchy / EE_QW_2_20070628