coolispaul
asked on
Flash Vertical Scroller
Hi,
I am trying to create a vertical scroller that moves up and down and contains external swf's from an cml file.
I have created an empty movie clip to hold the external swf's but cant get it to link out to a website. here is the code:
onClipEvent (load) {
for(i=1;i<=8;i++) {
this.createEmptyMovieClip( "container _mc"+i, this.getNextHighestDepth() );
//add spacing between each swf
if(i>1) {
this["container_mc"+i]._y +=(88*i-88);
}
this["container_mc"+i].loa dMovie("sw f"+i+".swf ");
trace(this["container_mc"+ i]);
this["container_mc"+i].onR elease = function() { trace("clicked");
getURL('http://www.bbc.co.uk');
}
}
Any ideas how to get something like this working?
Thanks
I am trying to create a vertical scroller that moves up and down and contains external swf's from an cml file.
I have created an empty movie clip to hold the external swf's but cant get it to link out to a website. here is the code:
onClipEvent (load) {
for(i=1;i<=8;i++) {
this.createEmptyMovieClip(
//add spacing between each swf
if(i>1) {
this["container_mc"+i]._y +=(88*i-88);
}
this["container_mc"+i].loa
trace(this["container_mc"+
this["container_mc"+i].onR
getURL('http://www.bbc.co.uk');
}
}
Any ideas how to get something like this working?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You code is correct, just needs a closing } right at the end.
Also this code needs to be added to a movieclip symbol on the timeline as it is a clipEvent.
So, create a new movieclip symbol if you haven't already got one, then drag it to the stage, make sure it is selected on the stage and paste your code into the actions panel.
Then test your movie, obviously having your series of swf1.swf, swf2.swf etc in the same directory.
MC
Also this code needs to be added to a movieclip symbol on the timeline as it is a clipEvent.
So, create a new movieclip symbol if you haven't already got one, then drag it to the stage, make sure it is selected on the stage and paste your code into the actions panel.
Then test your movie, obviously having your series of swf1.swf, swf2.swf etc in the same directory.
MC
onClipEvent (load) {
for(i=1;i<=8;i++) {
this.createEmptyMovieClip("container_mc"+i, this.getNextHighestDepth());
//add spacing between each swf
if(i>1) {
this["container_mc"+i]._y +=(88*i-88);
}
this["container_mc"+i].loadMovie("swf"+i+".swf");
trace(this["container_mc"+i]);
this["container_mc"+i].onRelease = function() { trace("clicked");
getURL('http://www.bbc.co.uk');
}
}
}
ASKER
Great thanks - that works .
Also one other question related to this.
How can i get the scroller to loop? i.e i have teh stage that holds 4 external swfs at once. I have the parent movieclip moving vertically upwards so that all 8 swfs are shown but then it blanks out. How can i get external SWF1 to show straight after SWF8 and therby giving the impression they are looping?
Thanks
Also one other question related to this.
How can i get the scroller to loop? i.e i have teh stage that holds 4 external swfs at once. I have the parent movieclip moving vertically upwards so that all 8 swfs are shown but then it blanks out. How can i get external SWF1 to show straight after SWF8 and therby giving the impression they are looping?
Thanks
with due respect,
this seems like another question which is not covered in current question details..
I request to open a new question with appropriate question heading, I will definitely provide the solution there.
Reason is,
Solution to nested questions are not searchable to other EE users.
IF we use proper question heading for each question,
Other users similar problem can easily search the question heading to get the solution.
this seems like another question which is not covered in current question details..
I request to open a new question with appropriate question heading, I will definitely provide the solution there.
Reason is,
Solution to nested questions are not searchable to other EE users.
IF we use proper question heading for each question,
Other users similar problem can easily search the question heading to get the solution.
code must wait to load the external SWF completely, before apply onRelease action on same movieClip.
what happening in your case:
loadMovie start loading SWF,
code attachs an onRelease event to the same movieClip,
and now SWF load completes and all events gets cleared to the movieClip.
below is the updated code, which actual loads swf into a child movieCLip and onRelease event has been attached to the parent movieClip.
now this should work fine:
Open in new window