Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sammich

macrumors 601
Original poster
Sep 26, 2006
4,305
268
Sarcasmville.
I'm doing a quick prototype for a school iPhone app and I've been messing around in Dashcode.

Just putting the finishing touches to the webapp and I've figured out the transitions with Apple's Docs but I've no idea how to pass in the direction argument (I can't have a 'back' transition going forward).

Where would I put:
Code:
Transition.LEFT_TO_RIGHT_DIRECTION
into
Code:
newTransition = new Transition(Transition.PUSH_TYPE, 0.5, Transition.EASE_TIMING);
document.getElementById('stackLayout').object.setCurrentViewWithTransition('main', newTransition, false);}
to make the transition work in the specified direction?

Thanks in advance!
Sam.
 
An Answer!

I looked all over the Internet. A Google search only found a few results. I ended up digging through the source code of the stackLayout component.

You have to set the direction property of your transition object, rather than passing it into the constructor. Like this:

Code:
newTransition = new Transition(Transition.PUSH_TYPE, 0.5, Transition.EASE_TIMING);
newTransition.direction = Transition.LEFT_TO_RIGHT_DIRECTION;
document.getElementById('stackLayout').object.setCurrentViewWithTransition('main', newTransition, false);}

Hope this helps you (I know its a late response) and the many other people searching the same thing.
 
Dude, you are amazing! It's not too late, I was just making another pet webapp so this is brilliant.

Thank you so much!

/cookie for you :D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.