Quote:
|
another questions jaxjon, can i submit 1 button to move 2 layer at the same time it pressed ?
|
Say you have a dock (Layer_1) at -360,0 or outside the left side of the screen to start and you have another (Layer_2) at 0,0 or directly in the center of the screen. Assuming both are 360x480 px you can use the transformations below to move Layer_1 into view and Layer_2 out of view with a button called dock_in
<animateTransform xlink:href="#Layer_1" id="_anim_l01" attributeName="transform" type="translate"
to="360,0"
dur="0.4s"
fill="freeze"
begin="dock_in.focusin" />
<animateTransform xlink:href="#Layer_2" id="_anim_l02" attributeName="transform" type="translate"
to="-360,0"
dur="0.4s"
fill="freeze"
begin="dock_in.focusin" />
To move them back to their original places with the same button you would need to create a duplicate button underneath the first one and call it say dock_out and use this code
<set xlink:href="#dock_out" attributeName="display" to="inline" begin="dock_in.focusin"/>
<set xlink:href="#dock_in" attributeName="display" to="none" begin="dock_in.focusin"/>
<set xlink:href="#dock_in" attributeName="display" to="inline" begin="dock_out.focusin"/>
<set xlink:href="#dock_out" attributeName="display" to="none" begin="dock_out.focusin"/>
<animateTransform xlink:href="#Layer_1" id="_anim_l03" attributeName="transform" type="translate"
to="0,0"
dur="0.4s"
fill="freeze"
begin="dock_out.focusin" />
<animateTransform xlink:href="#Layer_2" id="_anim_l04" attributeName="transform" type="translate"
to="0,0"
dur="0.4s"
fill="freeze"
begin="dock_out.focusin" />
This can be used to make multiple home screens if you make each layer 360x480 size. You can even have 3 or more buttons on top of each other to scroll through 3 or more layers and move them each time, you just have to remember to only show one button at a time and hide all others.
Quote:
|
if i want to make one button to close automaticly within the time, we need to change the "freeze" code to what kind of code ?
|
If you want something to happen a certain time after a button has been pressed just add "+xs" after the focusin or activate event in your code where x=#of seconds to wait so .focusin+2s means it ill wait 2 seconds before firing the code before it. Not sure if there is a maximum but I know you can't do anything but positive integers.
I hope this helps answer your questions.