-
1. Re: Increase/decrease text field number?
TimJaramillo Mar 6, 2013 6:02 PM (in response to rossfranks)Hi pancreasboy,
You will basically want to create a variable, and increment or decrement it on click, then update your dynamic text field on each click.
You can do something like this on Stage.compositionReady:
var currentCount = 0;// count current count
var maxCount = 4;// max number of slides/labels/images/whatever you have
// call this on left arrow click
sym.onClickLeft = function(){
if( currentCount > 0){
currentCount--;
// update your text
sym.$("txt_dynamic").html( currentCount +"");// convert number to string
// go to label on timeline
}
}
// call this on right arrow click
sym.onClickRight = function(){
if( currentCount < maxCount){
currentCount++;
// update your text
sym.$("txt_dynamic").html( currentCount +"");// convert number to string
// go to label on timeline
}
}
-
2. Re: Increase/decrease text field number?
rossfranks Mar 7, 2013 3:08 PM (in response to TimJaramillo)Thanks TimJaramillo,
that's exactly what I was after, one thing...
if i have the text in a symbol is this how I write it?
sym.getSymbol("pgNum").sym.$("pgText").html( currentCount +"");
because I tried that and it didn't work.
Also is there a better way to jump to a next and previous label rather than using
sym.play();
and
sym.playReverse();
thanks in advance.
-
3. Re: Increase/decrease text field number?
TimJaramillo Mar 7, 2013 3:19 PM (in response to rossfranks)Hey pancreas,
Try this:
sym.getSymbol("pgNum").$("pgText").html( currentCount +"");
To jump to a specific label (in this example it would jump to "label_1", if currentCount is 1), you can do this:
sym.play("label_"+currentCount);
-
4. Re: Increase/decrease text field number?
rossfranks Mar 7, 2013 3:31 PM (in response to TimJaramillo)Hmm sorry neither of those worked.
This is all in the compostionReady right?
-
5. Re: Increase/decrease text field number?
TimJaramillo Mar 7, 2013 3:34 PM (in response to rossfranks)Yep, at compositionReady.
Whenever something doesn't work, the first thing you can do is add console.logs in your code, to track down what's not working.
Can you post a zip of all your files?
-
6. Re: Increase/decrease text field number?
rossfranks Mar 7, 2013 3:40 PM (in response to TimJaramillo) -
7. Re: Increase/decrease text field number?
TimJaramillo Mar 7, 2013 3:52 PM (in response to rossfranks)Hey pancreas, it looks like you're not calling the "arrowBtnLt" and "arrowBtnRt" functions, on left/right arrow button click.
Put this on arrowBtnLt.click:
sym.arrowBtnLt();
Put this on arrowBtnRt.click:
sym.arrowBtnRt();
Also, since your label is probably going to start from 1, at document.compositionReady, replace the "currentCount" default value, and the if statement value for left button like this:
// insert code to be run when the composition is fully loaded here
var currentCount = 1;// count current count
var maxCount = 4;// max number of slides/labels/images/whatever you have
sym.arrowBtnLt = function(){
if( currentCount > 1){
currentCount--;
// update your text
sym.getSymbol("pgNum").$("pgText").html( currentCount +"");// convert number to string
// go to label on timeline
}
}
// call this on right arrow click
sym.arrowBtnRt = function(){
if( currentCount < maxCount){
currentCount++;
// update your text
sym.getSymbol("pgNum").$("pgText").html( currentCount +"");
// go to label on timeline
}
}
-
8. Re: Increase/decrease text field number?
rossfranks Mar 7, 2013 4:24 PM (in response to TimJaramillo)You're a champion Tim,
thanks for all you're help.
-
9. Re: Increase/decrease text field number?
TimJaramillo Mar 7, 2013 4:29 PM (in response to rossfranks)Glad to help!
-
10. Re: Increase/decrease text field number?
rossfranks Mar 7, 2013 7:00 PM (in response to TimJaramillo)Ok sorry to continue this, but now I've added a menu button which kind of screws up the page numbering, see my file here...
http://dl.dropbox.com/u/5569346/testMenu.zip
Basically I've done a menu that shows 3 links (for some reason you have to roll over it twice to appear, do you know why?) and on clicking on the slide 3 link takes you to the 3rd slide but when clicking backwards to slide 2 it doesn't work.
Thanks again.
-
11. Re: Increase/decrease text field number?
rossfranks Mar 10, 2013 3:29 PM (in response to rossfranks)Also if I'm using this code (taken from this tutorial http://tv.adobe.com/watch/create-like-crazy-with-adobe-edge/flexible-layouts-using-adobe-e dge-animate-and-the-edge-commons-library/):
//in compositionReady
yepnope({
load: "http://simonwidjaja.github.com/EdgeCommons/live/EdgeCommons-0.4.0.js",
//load: "http://localhost/Aktiv/Intern/EdgeCommons/GitHub/master/sprint/EdgeCommons-Sprint-0.0.4.js",
//load: "http://localhost/Aktiv/Intern/EdgeCommons/GitHub/master/live/EdgeCommons-0.4.0.js",
callback: function() {
EC.setAdaptiveLayouts( [300, 600, 1024] );
EC.applyAdaptiveLayout(sym, "adaptiveContainer");
}
});
// and in "resize"
//console.log("resize");
if (EC) {
EC.applyAdaptiveLayout(sym, "adaptiveContainer");
}
// insert code for resize event here
to change my pages depending on what the browser size is. How do I target a symbol that's changing on the stage?
Thanks in advance.
-
12. Re: Increase/decrease text field number?
TimJaramillo Mar 12, 2013 10:06 AM (in response to rossfranks)Hey pancreas, since this is a completely different topic from your original thread, I think you will get more help if you start a new thread titled something like: "Edge Commons Flexible Layout".
-
13. Re: Increase/decrease text field number?
rossfranks Mar 12, 2013 4:08 PM (in response to TimJaramillo)Done


