Advertisement

06.13.2008 at 07:05AM PDT, ID: 23482741
[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.2

How to add hypertext link attribute to an existing flash component using xml?

Asked by gustafson_barbara in Extensible Markup Language (XML), Macromedia Flash

Tags:

I recently purchased a Flash Component and wanted to add hypertext link attribute. I have requested this information from the component author, but have not been able to obtain a response. I have limited knowledge in this area and when I purchased the component I was assured that the author would help me. The component is a flash video gallery. I have attached the xml code and the action script code. Any information on how I can accomplish this would be greatly appreciated.

Thanks in advance!Start Free Trial
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:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
xml code:
 
<!-- 
  - contains information about video files 
  - each video item has the id, title, preview and description attributes
  - the id is the same for both xml and html layout file  
-->
 
<?xml version="1.0" encoding="utf-8?>
<videos>
	<video id="v1" title="Bourne Ultimatum" preview="videos/bourneultimatum.flv" description="Bourne is once again brought out of hiding, this time inadvertently by London-based reporter Simon Ross who is trying to unveil Operation Blackbriar--an upgrade to Project Treadstone--in a series of newspaper columns. Bourne sets up a meeting with Ross and realizes instantly they're being scanned. Information from the reporter stirs a new set of memories, and Bourne must finally, ultimately, uncover his dark past whilst dodging The Company's best efforts in trying to eradicate him. After being recovered from the sea, and after losing the one he loves, Jason Bourne is one more step closer to finding out how David Webb became Jason Bourne. Whilst Pamela Landy has decided to leave Bourne alone, CIA Deputy Director Noah Vosen has other plans. He believes that Bourne is still dangerous and must be eliminated, before he finds out his true identity and takes the CIA down with him." />
	<video id="v2" title="Die Hard" preview="videos/livefreeordiehard.flv" description="When someone hacks into the computers at the FBI's Cyber Crime Division; the Director decides to round up all the hackers who could have done this. When he's told that because it's the 4th of July most of their agents are not around so they might have trouble getting people to get the hackers. So he instructs them to get local PD'S to take care of it. And one of the cops they ask is John McClane who is tasked with bringing a hacker named Farrell to the FBI. But as soon as he gets there someone starts shooting at them. McClane manages to get them out but they're still being pursued. And it's just when McClane arrives in Washington that the whole system breaks down and chaos ensues." />	
	<video id="v3" title="Ratatouille" preview="videos/ratatouille.flv" description="A rat named Remy dreams of becoming a great French chef despite his family's wishes and the obvious problem of being a rat in a decidedly rodent-phobic profession. When fate places Remy in the sewers of Paris, he finds himself ideally situated beneath a restaurant made famous by his culinary hero, Auguste Gusteau. Despite the apparent dangers of being an unlikely - and certainly unwanted - visitor in the kitchen of a fine French restaurant, Remy's passion for cooking soon sets into motion a hilarious and exciting rat race that turns the culinary world of Paris upside down." />	
   <video id="v4" title="Spiderman" preview="videos/spiderman.flv" description="Peter Parker has finally managed to piece together the once-broken parts of his life, maintaining a balance between his relationship with Mary-Jane and his responsibility as Spider-Man. But more challenges arise for our young hero. Peter's old friend Harry Obsourne has set out for revenge against Peter; taking up the mantle of his late father's persona as The New Goblin, and Peter must also capture Uncle Ben's real killer, Flint Marko, who has been transformed into his toughest foe yet, the Sandman. All hope seems lost when suddenly Peter's suit turns jet-black and greatly amplifies his powers. But it also begins to greatly amplify the much darker qualities of Peter's personality that he begins to lose himself to. Peter has to reach deep inside himself to free the compassionate hero he used to be if he is to ever conquer the darkness within and face not only his greatest enemies, but also...himself." />	
   	<video id="v5" title="Bourne Ultimatum" preview="videos/bourneultimatum.flv" description="Bourne is once again brought out of hiding, this time inadvertently by London-based reporter Simon Ross who is trying to unveil Operation Blackbriar--an upgrade to Project Treadstone--in a series of newspaper columns. Bourne sets up a meeting with Ross and realizes instantly they're being scanned. Information from the reporter stirs a new set of memories, and Bourne must finally, ultimately, uncover his dark past whilst dodging The Company's best efforts in trying to eradicate him. After being recovered from the sea, and after losing the one he loves, Jason Bourne is one more step closer to finding out how David Webb became Jason Bourne. Whilst Pamela Landy has decided to leave Bourne alone, CIA Deputy Director Noah Vosen has other plans. He believes that Bourne is still dangerous and must be eliminated, before he finds out his true identity and takes the CIA down with him." />
	<video id="v6" title="Die Hard" preview="videos/livefreeordiehard.flv" description="When someone hacks into the computers at the FBI's Cyber Crime Division; the Director decides to round up all the hackers who could have done this. When he's told that because it's the 4th of July most of their agents are not around so they might have trouble getting people to get the hackers. So he instructs them to get local PD'S to take care of it. And one of the cops they ask is John McClane who is tasked with bringing a hacker named Farrell to the FBI. But as soon as he gets there someone starts shooting at them. McClane manages to get them out but they're still being pursued. And it's just when McClane arrives in Washington that the whole system breaks down and chaos ensues." />	
  <video id="v7" title="Bourne Ultimatum" preview="videos/bourneultimatum.flv" description="Bourne is once again brought out of hiding, this time inadvertently by London-based reporter Simon Ross who is trying to unveil Operation Blackbriar--an upgrade to Project Treadstone--in a series of newspaper columns. Bourne sets up a meeting with Ross and realizes instantly they're being scanned. Information from the reporter stirs a new set of memories, and Bourne must finally, ultimately, uncover his dark past whilst dodging The Company's best efforts in trying to eradicate him. After being recovered from the sea, and after losing the one he loves, Jason Bourne is one more step closer to finding out how David Webb became Jason Bourne. Whilst Pamela Landy has decided to leave Bourne alone, CIA Deputy Director Noah Vosen has other plans. He believes that Bourne is still dangerous and must be eliminated, before he finds out his true identity and takes the CIA down with him." />
  <video id="v8" title="Spiderman" preview="videos/spiderman.flv" description="Peter Parker has finally managed to piece together the once-broken parts of his life, maintaining a balance between his relationship with Mary-Jane and his responsibility as Spider-Man. But more challenges arise for our young hero. Peter's old friend Harry Obsourne has set out for revenge against Peter; taking up the mantle of his late father's persona as The New Goblin, and Peter must also capture Uncle Ben's real killer, Flint Marko, who has been transformed into his toughest foe yet, the Sandman. All hope seems lost when suddenly Peter's suit turns jet-black and greatly amplifies his powers. But it also begins to greatly amplify the much darker qualities of Peter's personality that he begins to lose himself to. Peter has to reach deep inside himself to free the compassionate hero he used to be if he is to ever conquer the darkness within and face not only his greatest enemies, but also...himself." />
  <video id="v9" title="Ratatouille" preview="videos/ratatouille.flv" description="A rat named Remy dreams of becoming a great French chef despite his family's wishes and the obvious problem of being a rat in a decidedly rodent-phobic profession. When fate places Remy in the sewers of Paris, he finds himself ideally situated beneath a restaurant made famous by his culinary hero, Auguste Gusteau. Despite the apparent dangers of being an unlikely - and certainly unwanted - visitor in the kitchen of a fine French restaurant, Remy's passion for cooking soon sets into motion a hilarious and exciting rat race that turns the culinary world of Paris upside down." />	
  <video id="v10" title="Spiderman" preview="videos/spiderman.flv" description="Peter Parker has finally managed to piece together the once-broken parts of his life, maintaining a balance between his relationship with Mary-Jane and his responsibility as Spider-Man. But more challenges arise for our young hero. Peter's old friend Harry Obsourne has set out for revenge against Peter; taking up the mantle of his late father's persona as The New Goblin, and Peter must also capture Uncle Ben's real killer, Flint Marko, who has been transformed into his toughest foe yet, the Sandman. All hope seems lost when suddenly Peter's suit turns jet-black and greatly amplifies his powers. But it also begins to greatly amplify the much darker qualities of Peter's personality that he begins to lose himself to. Peter has to reach deep inside himself to free the compassionate hero he used to be if he is to ever conquer the darkness within and face not only his greatest enemies, but also...himself." />	
  <video id="v11" title="Die Hard" preview="videos/livefreeordiehard.flv" description="When someone hacks into the computers at the FBI's Cyber Crime Division; the Director decides to round up all the hackers who could have done this. When he's told that because it's the 4th of July most of their agents are not around so they might have trouble getting people to get the hackers. So he instructs them to get local PD'S to take care of it. And one of the cops they ask is John McClane who is tasked with bringing a hacker named Farrell to the FBI. But as soon as he gets there someone starts shooting at them. McClane manages to get them out but they're still being pursued. And it's just when McClane arrives in Washington that the whole system breaks down and chaos ensues." />		
  <video id="v12" title="Bourne Ultimatum" preview="videos/bourneultimatum.flv" description="Bourne is once again brought out of hiding, this time inadvertently by London-based reporter Simon Ross who is trying to unveil Operation Blackbriar--an upgrade to Project Treadstone--in a series of newspaper columns. Bourne sets up a meeting with Ross and realizes instantly they're being scanned. Information from the reporter stirs a new set of memories, and Bourne must finally, ultimately, uncover his dark past whilst dodging The Company's best efforts in trying to eradicate him. After being recovered from the sea, and after losing the one he loves, Jason Bourne is one more step closer to finding out how David Webb became Jason Bourne. Whilst Pamela Landy has decided to leave Bourne alone, CIA Deputy Director Noah Vosen has other plans. He believes that Bourne is still dangerous and must be eliminated, before he finds out his true identity and takes the CIA down with him." />
</videos>
 
Action Script:
 
//PARAMETERS//
 
var videoData = "videoInfo.xml"; //video info xml file 
var htmlTableList = "videoLayout1.html"; //html table template for the video list
 
var flvPlayerPath = this._parent.playerBox; //path to FLV player Movie Clip
var descriptionBox = this._parent.videoDescriptionBox.videoDescription; //path to description Movie Clip
var titleBox = this._parent.videoTitleBox; //path to title Movie Clip
 
//END PARAMTERS//
 
//-----------------------------------------------------------------------------
// FOR MORE INFO ON ALL THE SUPPORTED METHODS, PROPERTIES AND EVENTS       
// PLEASE CHECK THE FT TABLE RENDERER AND FT SCROLLBAR  HELPBOOKS THAT CAN BE ACCESSED  //
// VIA THE FLASH HELP PANEL AND THE EXAMPLES INCLUDED IN THE DOWNLOAD PACKAGES     
// AND THE ONLINE REFERENCES                                                   
//------------------------------------------------------------------------------
 
var xmlObj; //used in calculation
 
var listener = new Object();
var mcpath = this;
 
//default hide boxes and display them with some fading effect after movie loads
this._alpha = 0; // video list box
titleBox._alpha = 0;
descriptionBox._parent._alpha = 0;
flvPlayerPath._alpha = 0;
 
 
listener.onTableRendered = function(evt) {
	
 
 fadeVideoList(); //add some fading effect	
	
 // assign press, roollOver, rollOut handlers
 
 var tableCells = new Array();
 tableCells = table.getCells(); //get table cells
 
 for(var i=0;i<tableCells.length;i++) {
  var cellMc = tableCells[i];	 
  var firstChar = cellMc._name.charAt(0);
  if (firstChar == "v") //is a video (the cell has id=v1 / id=v2 etc attributes) 
   {
	//get info
	var infObj = getVideoInfo(cellMc._name);
	cellMc["info"] = infObj;
	
	//start playing the first movie
	var firstVideo = cellMc["info"].attributes.preview;
	if (cellMc._name=="v1") {
		                     flvPlayerPath.videoMaru.playVideo(firstVideo);
							 titleBox.tf.text = infObj.attributes.title;
							 descriptionBox.tf.text = infObj.attributes.description;
							 
	}
	
	//add event handlers
	cellMc.onPress = pressHandler; 
	cellMc.onRollOver = rollOverHandler;
    cellMc.onRollOut = rollOutHandler;
   }
 }   
}
 
 
function init() {
 xmlObj = new XML(); 
 xmlObj.ignoreWhite = true;
 xmlObj.load(videoData); //load video data
 xmlObj.onLoad = function() {
	table.sourceFile = htmlTableList;
	table.addEventListener("onTableRendered",listener); //after table is rendered assign cell press,rollOver etc event handlers	
 } 
 //setFLVPlayerControls(); //set FLVPlayback controls
}
 
function getVideoInfo(id) { //search for video id and return info
 
var objects = xmlObj.firstChild.childNodes;
for(var i=0; i<objects.length; i++) {
 if (id==objects[i].attributes.id) return objects[i];
}
 return 0 //if not video id found
}
 
 
function pressHandler() {
 flvPlayerPath.videoMaru.playVideo(this["info"].attributes.preview);
 titleBox.tf.text = this["info"].attributes.title;
 descriptionBox.tf.text = this["info"].attributes.description;
}
 
function rollOverHandler() {
 table.setCell(this,"bgcolor","0x333333");
}
 
function rollOutHandler() {
 table.setCell(this,"bgcolor","0x1c1e20");
}
 
					
					
					
					//FADE EACH BOX ON THE STAGE AFTER THE MOVIE IS LOADED//
					
function fadeVideoList() {
 var listBox = table._parent;//mainContent.movieListBox;
 var func1 = mx.transitions.easing.Regular.easeOut;
 var xs = 0;
 var xf = 100;
 var duration1 = 1.5;
 var tw1 = new mx.transitions.Tween(listBox, "_alpha", func1, xs, xf, duration1, true);
 //tw1.onMotionFinished = fadeTitle;
 tw1.onMotionChanged = checkCurrTime1;
}
 
function checkCurrTime1() {
//trace("Motion change: "+this.time+"  "+this.position);	
 if (this.time > 0.5)
   { 
    fadeTitle();
	delete this.onMotionChanged;	
   }
}
 
 
function fadeTitle() {
 var mc = titleBox;
 var func1 = mx.transitions.easing.Regular.easeOut;
 var xs = 0;
 var xf = 100;
 
 var duration1 = 0.5;
 var tw1 = new mx.transitions.Tween(mc, "_alpha", func1, xs, xf, duration1, true);
 //tw1.onMotionFinished = fadePlayerBox;
 tw1.onMotionChanged = checkCurrTime2;
}
 
function checkCurrTime2() {
//trace("Motion change: "+this.time+"  "+this.position);	
 if (this.time > 0.25)
   { 
    fadePlayerBox();
	delete this.onMotionChanged;	
   }
}
 
function fadePlayerBox() {
 var mc = flvPlayerPath;
 var func1 = mx.transitions.easing.Regular.easeOut;
 var xs = 0;
 var xf = 100;
 
 var duration1 = 0.5;
 var tw1 = new mx.transitions.Tween(mc, "_alpha", func1, xs, xf, duration1, true);
 //tw1.onMotionFinished = fadeVideoDescr;
 tw1.onMotionChanged = checkCurrTime3;
}
 
function checkCurrTime3() {
//trace("Motion change: "+this.time+"  "+this.position);	
 if (this.time > 0.25)
   { 
    fadeVideoDescr();
	delete this.onMotionChanged;	
   }
}
 
function fadeVideoDescr() {
 var mc = descriptionBox._parent;
 var func1 = mx.transitions.easing.Regular.easeOut;
 var xs = 0;
 var xf = 100;
 
 var duration1 = 0.5;
 var tw1 = new mx.transitions.Tween(mc, "_alpha", func1, xs, xf, duration1, true);
}
						 			
									// END FADING //
						
init(); //init call
[+][-]06.13.2008 at 09:30AM PDT, ID: 21780510

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Extensible Markup Language (XML), Macromedia Flash
Tags: flash 8 flash component, xml
Sign Up Now!
Solution Provided By: BongoMoose
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.13.2008 at 11:08AM PDT, ID: 21781350

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628