Hello everyone!
I have only been using Flash for a while, and am not sure how to go about this, so I need to know if it can be done or am I wasting my time?
I am loading a Jpeg using Loadmovie, it is hidden from view behind a graphic on a higher layer. What I want to do is make it scroll down past the top graphic when a button is clicked, then when another button is clicked make the current Jpeg scroll back behind and another take its place and then scroll down and so on…
I am fairly sure that this would be easier if it was all done using animated movie clips, but is it possible using only actionscript?
Thanks
Is ur question if that can be done?
If so , yes it can be done. Just place a container (an empty MC) in layer below your graphic, load the JPG onto it and move it at will
(vary its ‘_y’ property)(note that what u should move is the container movie and that the ‘_y’ point is in the top left corner of the JPG).
Hope it helps
SHO
Thanks, sounds logical.
What if where the final position of the jpeg was when it scrolls down had a masked vector over it (on a higher level). What I want is for that mask to scroll down as the Jpeg does revealing the vector over the top of it. This would all have to happen on different levels so how could I command the scrolling for both these levels from one button click???
Cheers
Hi,
Do you mean this?:
[AS]
function scrollImg(){
if(container._y < maximumContainerY){
container._y += 5;
}
if(mask._y < maximumMaskY){
mask._y += 5;
}
}
[/AS]
or is it:
[AS]
function scrollImg(){
if(container._y < maximumContainerY){
container._y += 5;
} else {
if(mask._y < maximumMaskY){
mask._y += 5;
}
}
}
[/AS]
this should happen on an enterFrame or interval and be triggered by the click of the button
SHO
Thanks again, I guess that i’m jumping in at the deepend here 
The first one seems to be closest, but do I just need to refer to the Jpeg and mask by their instance names or does the level they are on come into as well.
Also would I need to set the maximum and minimum values for y before hand, ie. the coordinates of where the image is initally and then where it will be after it is in its final position after scrolling?
Anyway, I will try this out later and see what happens.
Cheers.
Hi,
Yes, just refer to the Jpeg and mask by their instance names but make sure the mask is in a higher layer than the Jpg’s container (or if in the same layer in a higher z index [depth][on top, in plain english]).
U r right about the Max and Min values.
About the code in previous post the first one moves Jpg and mask at the same time and the second one waits for the Jpg to move and then moves the mask
SHO
what you really need is a change in stack right?
I think this will help you
http://www.kirupa.com/developer/actionscript/swapdepth.htm:)