Solved

Number style nav bar

Posted on 2009-04-06
43
403 Views
Last Modified: 2016-08-29
Hello, For the life if my I can't remember how to do this... I'll looking to get buttons that have the frame numbers it in that a user can click on to get there...

<< <  ... 4-5 6-7 8-9 ... > >>

something like that.... it's a flipbook I have to work with here...  so what I'm doing is counting the total frames... and loading to in a row.  so

4-5 button (in the box) would go to


      book.rightpage.gotoAndStop(5);
      book.leftpage.gotoAndStop(4);

there will be 88 frames so it's important to get this working...

right now for example on the lables I'm tracing

0-1,1-2,2-3,3-4,4-5,5-6,6-7,7-8,8-9,9-10,10-11,11-12,12-13,13-14,14-15,15-16
 to which it should be
0-1,2-3,4-5,6-7,8-9,10-11,12-13,14-15,16

So if some one can show me how to get the grouped numbered buttons really quick I can do the rest... I'm just brain farting how to do this big time...

thanks for the help

jeremyBass

stop();
import flash.filters.GlowFilter;
import flash.filters.DropShadowFilter;
 
animation._visible=false;
 
alphaTween = new mx.transitions.Tween (copyright, "_alpha",
mx.transitions.easing.Regular.easeInOut, 0, 100, 3,
true);
alphaTween = new mx.transitions.Tween (backgroundMC, "_alpha",
mx.transitions.easing.Regular.easeInOut, 0, 100, 1,
true);
alphaTween = new mx.transitions.Tween (book, "_alpha",
mx.transitions.easing.Regular.easeInOut, 0, 100, 0.75,
true);
alphaTween = new mx.transitions.Tween (player, "_alpha",
mx.transitions.easing.Regular.easeInOut, 0, 100, 1,
true);
 
var labels:Array = [];
 
 
var messages1:Array = ["Now that's a really sleek looking button that you have clicked.", "Oh! Another one.", "ActionScript rules.", "ActionScript and ActionScript only!"];
var offset:Number = 10;
 
 for (var i:Number = 0; i< book.leftpage._totalframes; i++) {
// trace(book.leftpage._totalframes);
  trace(i + 1);
labels.push (""+ (i+1) +"-"+ (i+2) +"");
trace(labels);
createButtons(1, 0xFAD4DB, 0xEC748B, 0xC13A59, 0xA81230, 0x820F26, 0xFFFFFF, 1, 37, 10, 0xFFFFFF, .30, 4, 3, true, false);
 }
function createButtons(buttonSeries:Number, color1:Number, color2:Number, color3:Number, color4:Number, lineColor:Number, labelColor:Number, numberOfButtons:Number, posX:Number, posY:Number, labelFilterColor:Number, labelFilterAlpha:Number, labelFilterBlur:Number, labelFilterStrength:Number, applyLabelFilter:Boolean, applyBkgFilter:Boolean) {
	for (var i:Number = 0; i<book.leftpage._totalframes; i++) {
		var labelGlow:GlowFilter = new GlowFilter(labelFilterColor, labelFilterAlpha, labelFilterBlur, labelFilterBlur, labelFilterStrength, 3);
		var labelFilters:Array = [labelGlow];
		var buttonShadow:DropShadowFilter = new DropShadowFilter(1, 45, 0x000000, 1, 4, 4, 1, 3);
		var buttonFilters:Array = [buttonShadow];
		var myButton:MovieClip = this.createEmptyMovieClip("myButton"+String(buttonSeries)+String(i), this.getNextHighestDepth());
		myButton._x = offset+(posX*i);
		myButton._y = offset+posY;
		var fillType:String = "linear";
		var colors:Array = [color1, color2, color3, color4];
		var alphas:Array = [100, 100, 100, 100];
		var ratios:Array = [0, 126, 127, 255];
		var matrix:Object = {matrixType:"box", x:0, y:0, w:35, h:30, r:90/180*Math.PI};
		myButton.createEmptyMovieClip("buttonBkg", myButton.getNextHighestDepth());
		myButton.buttonBkg.lineStyle(0, lineColor, 60, true, "none", "square", "round");
		myButton.buttonBkg.beginGradientFill(fillType, colors, alphas, ratios, matrix);
		myButton.buttonBkg.lineTo(35, 0);
		myButton.buttonBkg.lineTo(35, 30);
		myButton.buttonBkg.lineTo(0, 30);
		myButton.buttonBkg.lineTo(0, 0);
		myButton.buttonBkg.endFill();
		var myFormat:TextFormat = new TextFormat();
		myFormat.align = "center";
		myFormat.font = "Tahoma";
		myFormat.size = 13;
		myFormat.color = labelColor;
		myButton.createTextField("labelText", myButton.getNextHighestDepth(), 0, 5, myButton._width, 24);
		myButton.labelText.text = labels[i];
		myButton.labelText.embedFonts = true;
		myButton.labelText.selectable = false;
		myButton.labelText.antiAliasType = "advanced";
		myButton.labelText.setTextFormat(myFormat);
		if (applyLabelFilter) {
			myButton.labelText.filters = labelFilters;
		}
		if (applyBkgFilter) {
			myButton.filters = buttonFilters;
		}
		myButton.onPress = function() {
			var currentArray:Array = eval("messages"+buttonSeries);
			var currentButtonNumber:Number = this._name.substr(-1, 1);
			messageDisplay_txt.text = currentArray[currentButtonNumber];
					book.rightpage.gotoAndStop(i);
	book.leftpage.gotoAndStop(i);
	book.bl._visible=true;
	book.br._visible=true;
	trace("Went to:" + (i));
		}
	}
}

Open in new window

0
Comment
Question by:jeremyBass26
  • 32
  • 11
43 Comments
 
LVL 39

Expert Comment

by:blue-genie
ID: 24088032
var labels:Array = [];
 for (var i:Number = 0; i<88; i++) {

      
      labels.push (""+ i +"-"+ (i+1) +"");
      i++;
      trace(labels);
 }
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24088569
wow... so just adding

i++;

will incrament to the next one... did know that....

So from here I should ...??? group  each lable value... um and show five labes values... .... gosh I can not remeber how to do this... This stumped me that last time too... I'm just trying to end up with

<< < ... 5-6  7-8  9-10  11-12  13-14  ... > >>



Thanks for the help...

Jeremy
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24088802
I'm much closer now but I can't seem to get the numbers to show up for the label... and the myButton.onPress targets only the last page& in this case 5 when I  add the

trace("Went to:"+(i));

I just keep at it ... just not too sure...
stop();
 
import flash.filters.GlowFilter;
 
import flash.filters.DropShadowFilter;
 
 
 
animation._visible = false;
 
 
alphaTween = new mx.transitions.Tween(copyright, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 3, true);
alphaTween = new mx.transitions.Tween(backgroundMC, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
alphaTween = new mx.transitions.Tween(book, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 0.75, true);
alphaTween = new mx.transitions.Tween(player, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
 
 
 
var labels:Array = [];
var Opos:Array = [];
 
var messages1:Array = ["Now that's a really sleek looking button that you have clicked.", "Oh! Another one.", "ActionScript rules.", "ActionScript and ActionScript only!"];
 
var offset:Number = 10;
 
 
for (var i:Number = 0; i<book.leftpage._totalframes; i++) {
	trace(i+1);
	labels.push(""+(i)+"-"+(i+1)+"");
	i++;
 
}
 
 
 
for (var i:Number = 0; i<book.leftpage._totalframes; i++) {
	var counts = i + 1;
	if (counts <= 5){
		Opos.push(i);
		trace(Opos);
		createButtons(1,0xFAD4DB,0xEC748B,0xC13A59,0xA81230,0x820F26,0xFFFFFF,1,37,10,0xFFFFFF,.30,4,3,true,false);
	}
}
 
 
 
function createButtons(buttonSeries:Number, color1:Number, color2:Number, color3:Number, color4:Number, lineColor:Number, labelColor:Number, numberOfButtons:Number, posX:Number, posY:Number, labelFilterColor:Number, labelFilterAlpha:Number, labelFilterBlur:Number, labelFilterStrength:Number, applyLabelFilter:Boolean, applyBkgFilter:Boolean) {
 
	for (var i:Number = 0; i<Opos.length; i++) {
 
		var labelGlow:GlowFilter = new GlowFilter(labelFilterColor, labelFilterAlpha, labelFilterBlur, labelFilterBlur, labelFilterStrength, 3);
 
		var labelFilters:Array = [labelGlow];
 
		var buttonShadow:DropShadowFilter = new DropShadowFilter(1, 45, 0x000000, 1, 4, 4, 1, 3);
 
		var buttonFilters:Array = [buttonShadow];
 
		var myButton:MovieClip = this.createEmptyMovieClip("myButton"+String(buttonSeries)+String(i), this.getNextHighestDepth());
 
		myButton._x = offset+(posX*i);
 
		myButton._y = offset+posY;
 
		var fillType:String = "linear";
 
		var colors:Array = [color1, color2, color3, color4];
 
		var alphas:Array = [100, 100, 100, 100];
 
		var ratios:Array = [0, 126, 127, 255];
 
		var matrix:Object = {matrixType:"box", x:0, y:0, w:35, h:30, r:90/180*Math.PI};
 
		myButton.createEmptyMovieClip("buttonBkg",myButton.getNextHighestDepth());
 
		myButton.buttonBkg.lineStyle(0,lineColor,60,true,"none","square","round");
 
		myButton.buttonBkg.beginGradientFill(fillType,colors,alphas,ratios,matrix);
 
		myButton.buttonBkg.lineTo(35,0);
 
		myButton.buttonBkg.lineTo(35,30);
 
		myButton.buttonBkg.lineTo(0,30);
 
		myButton.buttonBkg.lineTo(0,0);
 
		myButton.buttonBkg.endFill();
 
		var myFormat:TextFormat = new TextFormat();
 
		myFormat.align = "center";
 
		myFormat.font = "Tahoma";
 
		myFormat.size = 13;
 
		myFormat.color = labelColor;
 
		myButton.createTextField("labelText",myButton.getNextHighestDepth(),0,5,myButton._width,24);
 
		myButton.labelText.text = labels[i];
 
		myButton.labelText.embedFonts = true;
 
		myButton.labelText.selectable = false;
 
		myButton.labelText.antiAliasType = "advanced";
 
		myButton.labelText.setTextFormat(myFormat);
 
		if (applyLabelFilter) {
 
			myButton.labelText.filters = labelFilters;
 
		}
 
		if (applyBkgFilter) {
 
			myButton.filters = buttonFilters;
 
		}
 
		myButton.onPress = function() {
 
			var currentArray:Array = eval("messages"+buttonSeries);
 
			var currentButtonNumber:Number = this._name.substr(-1, 1);
 
			messageDisplay_txt.text = currentArray[currentButtonNumber];
 
			book.rightpage.gotoAndStop(i);
 
			book.leftpage.gotoAndStop(i);
			
			Current = book.rightpage._currentframe;
			nextB = book.rightpage._currentframe + 1;
			prevB = book.leftpage._currentframe - 1;
 
			book.bl._visible = true;
 
			book.br._visible = true;
 
			trace("Went to:"+(i));
 
		};
 
	}
 
}

Open in new window

0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 4

Author Comment

by:jeremyBass26
ID: 24089451
ok... little closer... got the buttons to get the labels... they were tied to a font in the lib

myFormat.font = "Tahoma";

I'll need to fix that later... So here is the hard part of this question...

the

<< <  ... 4-5 6-7 8-9 ... > >>

hope to create that ... I'm stabbing in the dark... but at least I'm getting some where....

Thanks again for the help..

Jeremy

stop();
 
import flash.filters.GlowFilter;
 
import flash.filters.DropShadowFilter;
Current = book.rightpage._currentframe;
trace("Went to:"+(Current));
 
 
animation._visible = false;
 
 
alphaTween = new mx.transitions.Tween(copyright, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 3, true);
alphaTween = new mx.transitions.Tween(backgroundMC, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
alphaTween = new mx.transitions.Tween(book, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 0.75, true);
alphaTween = new mx.transitions.Tween(player, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
 
 
//var labels:Array = ["webdesign", "portfolio", "about me", "photo gallery"];
 
var labels:Array = [];
var Opos:Array = [];
 
var offset:Number = 10;
 
 
 
 
 
 
function createButtons(buttonSeries:Number, color1:Number, color2:Number, color3:Number, color4:Number, lineColor:Number, labelColor:Number, numberOfButtons:Number, posX:Number, posY:Number, labelFilterColor:Number, labelFilterAlpha:Number, labelFilterBlur:Number, labelFilterStrength:Number, applyLabelFilter:Boolean, applyBkgFilter:Boolean) {
 
	for (var i:Number = 0; i<Opos.length; i++) {
 
		var labelGlow:GlowFilter = new GlowFilter(labelFilterColor, labelFilterAlpha, labelFilterBlur, labelFilterBlur, labelFilterStrength, 3);
		var labelFilters:Array = [labelGlow];
		var buttonShadow:DropShadowFilter = new DropShadowFilter(1, 45, 0x000000, 1, 4, 4, 1, 3);
		var buttonFilters:Array = [buttonShadow];
		var myButton:MovieClip = this.createEmptyMovieClip("myButton"+String(buttonSeries)+String(i), this.getNextHighestDepth());
		myButton._x = offset+(posX*i);
		myButton._y = offset+posY;
		var fillType:String = "linear";
		var colors:Array = [color1, color2, color3, color4];
		var alphas:Array = [100, 100, 100, 100];
		var ratios:Array = [0, 126, 127, 255];
		var matrix:Object = {matrixType:"box", x:0, y:0, w:35, h:30, r:90/180*Math.PI};
		myButton.createEmptyMovieClip("buttonBkg", myButton.getNextHighestDepth());
		myButton.buttonBkg.lineStyle(0, lineColor, 60, true, "none", "square", "round");
		myButton.buttonBkg.beginGradientFill(fillType, colors, alphas, ratios, matrix);
		myButton.buttonBkg.lineTo(35, 0);
		myButton.buttonBkg.lineTo(35, 30);
		myButton.buttonBkg.lineTo(0, 30);
		myButton.buttonBkg.lineTo(0, 0);
		myButton.buttonBkg.endFill();
		var myFormat:TextFormat = new TextFormat();
		myFormat.align = "center";
		myFormat.font = "Tahoma";
		myFormat.size = 13;
		myFormat.color = labelColor;
		myButton.createTextField("labelText", myButton.getNextHighestDepth(), 0, 5, myButton._width, 24);
		myButton.labelText.text = labels[i];
		myButton.labelText.embedFonts = true;
		myButton.labelText.selectable = false;
		myButton.labelText.antiAliasType = "advanced";
		myButton.labelText.setTextFormat(myFormat);
		if (applyLabelFilter) {
			myButton.labelText.filters = labelFilters;
		}
		if (applyBkgFilter) {
			myButton.filters = buttonFilters;
		}
 
		myButton.onPress = function() {
 
			var currentArray:Array = eval("messages"+buttonSeries);
 
			var currentButtonNumber:Number = this._name.substr(-1, 1);
 
			messageDisplay_txt.text = currentArray[currentButtonNumber];
 
			book.rightpage.gotoAndStop(i);
 
			book.leftpage.gotoAndStop(i);
			
			Current = book.rightpage._currentframe;
			nextB = book.rightpage._currentframe + 1;
			prevB = book.leftpage._currentframe - 1;
 
			book.bl._visible = true;
 
			book.br._visible = true;
 
			trace("Went to:"+(Current));
 
		};
 
	}
 
}
for (var i:Number = 0; i<book.leftpage._totalframes; i++) {
	trace(i+1);
	labels.push(""+(i)+"-"+(i+1)+"");
	i++;
 
}
 
 
 
for (var i:Number = 0; i<book.leftpage._totalframes; i++) {
	var counts = i + 1;
	if (counts <= 5){
		Opos.push(i);
		trace(Opos);
		createButtons(2, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 38, 80, 0xFFFFFF, .40, 4, 3, false, true);
	}
}

Open in new window

0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24090099
Oh... I have a wonderfull Idea I hope... since I can't find a as2 script for a pager.... I thought I'd try to base it of a js version...

Should work ... I'd think... any help here would be great... thank you....
function showpageCount(json) {
var thisUrl = location.href;
var htmlMap = new Array();
var isFirstPage = thisUrl.substring(thisUrl.length-14,thisUrl.length)==.blogspot.com/;
var isLablePage = thisUrl.indexOf(/search/label/)!=-1;
var isPage = thisUrl.indexOf(/search?updated)!=-1;
var thisLable = isLablePage ? thisUrl.substr(thisUrl.indexOf(/search/label/)+14,thisUrl.length) : ;
thisLable = thisLable.indexOf(?)!=-1 ? thisLable.substr(0,thisLable.indexOf(?)) : thisLable;
var thisNum = 1;
var postNum=1;
var itemCount = 0;
var fFlag = 0;
var eFlag = 0;
var html= ;
var upPageHtml =;
var downPageHtml =;
 
var pageCount=5;
var displayPageNum=3;
var firstPageWord = First;
var endPageWord = Last;
var upPageWord =Previous;
var downPageWord =Next;
 
var labelHtml = <span class=showpageNum><a href=/search/label/+thisLable+?&max-results=+pageCount+>;
 
for(var i=0, post; post = json.feed.entry[i]; i++) {
var timestamp = post.published.$t.substr(0,10);
var title = post.title.$t;
if(isLablePage){
if(title!=){
if(post.category){
for(var c=0, post_category; post_category = post.category[c]; c++) {
if(encodeURIComponent(post_category.term)==thisLable){
if(itemCount==0 || (itemCount % pageCount ==(pageCount-1))){
if(thisUrl.indexOf(timestamp)!=-1 ){
thisNum = postNum;
}
 
postNum++;
htmlMap[htmlMap.length] = /search/label/+thisLable+?updated-max=+timestamp+T00%3A00%3A00%2B08%3A00&max-results=+pageCount;
}
}
}
}//end if(post.category){
 
itemCount++;
}
 
}else{
if(title!=){
if(itemCount==0 || (itemCount % pageCount ==(pageCount-1))){
if(thisUrl.indexOf(timestamp)!=-1 ){
thisNum = postNum;
}
 
if(title!=) postNum++;
htmlMap[htmlMap.length] = /search?updated-max=+timestamp+T00%3A00%3A00%2B08%3A00&max-results=+pageCount;
}
}
itemCount++;
}
}
 
for(var p =0;p< htmlMap.length;p++){
if(p>=(thisNum-displayPageNum-1) && p<(thisNum+displayPageNum)){
if(fFlag ==0 && p == thisNum-2){
if(thisNum==2){
if(isLablePage){
upPageHtml = labelHtml + upPageWord +</a></span>;
}else{
upPageHtml = <span class=showpage><a href=/>+ upPageWord +</a></span>;
}
}else{
upPageHtml = <span class=showpage><a href=+htmlMap[p]+>+ upPageWord +</a></span>;
}
 
fFlag++;
}
 
if(p==(thisNum-1)){
html += &nbsp;<span class=showpagePoint><u>+thisNum+</u></span>;
}else{
if(p==0){
if(isLablePage){
html = labelHtml+1</a></span>;
}else{
html += <span class=showpageNum><a href=/>1</a></span>;
}
}else{
html += <span class=showpageNum><a href=+htmlMap[p]+>+ (p+1) + </a></span>;
}
}
 
if(eFlag ==0 && p == thisNum){
downPageHtml = <span class=showpage> <a href=+htmlMap[p]+>+ downPageWord +</a></span>;
eFlag++;
}
}//end if(p>=(thisNum-displayPageNum-1) && p<(thisNum+displayPageNum)){
}//end for(var p =0;p< htmlMap.length;p++){
 
if(thisNum>1){
if(!isLablePage){
html = <span class=showpage><a href=/>+ firstPageWord + </a></span>+upPageHtml+ +html + ;
}else{
html = +labelHtml + firstPageWord + </a></span>+upPageHtml+ +html + ;
}
}
 
html = <div class=showpageArea><span style=font-size:11px;padding: 2px 4px 2px 4px;margin: 2px 2px 2px 2px;color: #000000;border: 1px solid #333; background-color: #FFFFFF; class=showpage>Page +thisNum+ of +(postNum-1)+: </span>+html;
 
if(thisNum<(postNum-1)){
html += downPageHtml;
html += <span class=showpage><a href=+htmlMap[htmlMap.length-1]+> +endPageWord+</a></span>;
}
 
if(postNum==1) postNum++;
html += </div>;
 
if(isPage || isFirstPage || isLablePage){
var pageArea = document.getElementsByName(pageArea);
var blogPager = document.getElementById(blog-pager);
 
if(postNum <= 2){
html =;
}
 
for(var p =0;p< pageArea.length;p++){
pageArea[p].innerHTML = html;
}
 
if(pageArea&&pageArea.length>0){
html =;
}
 
if(blogPager){
blogPager.innerHTML = html;
}
}
 
}

Open in new window

0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24090574
@blue-genie
When I said...
>>>>So if some one can show me how to get the grouped numbered buttons really quick I can do the rest

You thought I meant the 1-2 groups ... yes??.. so you'd want me to reask the question as ... well you could say that it you solved it...

I will do that if you want me to...

I just need to end up with

<< < ... 5-6  7-8  9-10  11-12  13-14  ... > >>

what ever works, I'm just spinning my wheels here lol...

Thank you for the help...

Jeremy
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24090700
this has the button moving the pages(frames) right... thou when it reaches the end it starts over...

so when you get to 16

where

var totalFrameCT:Number = book.leftpage._totalframes;

was 16

it then starts at 1 again... is' just advancing no matter what button I press...

.. two forward one back... :)

stop();
 
import flash.filters.GlowFilter;
 
import flash.filters.DropShadowFilter;
Current = book.rightpage._currentframe;
trace("Went to:"+(Current));
 
 
animation._visible = false;
 
 
alphaTween = new mx.transitions.Tween(copyright, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 3, true);
alphaTween = new mx.transitions.Tween(backgroundMC, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
alphaTween = new mx.transitions.Tween(book, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 0.75, true);
alphaTween = new mx.transitions.Tween(player, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
 
var labels:Array = [];
var Opos:Array = [];
 
var offset:Number = 10;
var totalFrameCT:Number = book.leftpage._totalframes;
 
 
 
 
 
function createButtons(buttonSeries:Number, color1:Number, color2:Number, color3:Number, color4:Number, lineColor:Number, labelColor:Number, numberOfButtons:Number, posX:Number, posY:Number, labelFilterColor:Number, labelFilterAlpha:Number, labelFilterBlur:Number, labelFilterStrength:Number, applyLabelFilter:Boolean, applyBkgFilter:Boolean) {
 
	for (var i:Number = 0; i<Opos.length; i++) {
 
		var labelGlow:GlowFilter = new GlowFilter(labelFilterColor, labelFilterAlpha, labelFilterBlur, labelFilterBlur, labelFilterStrength, 3);
		var labelFilters:Array = [labelGlow];
		var buttonShadow:DropShadowFilter = new DropShadowFilter(1, 45, 0x000000, 1, 4, 4, 1, 3);
		var buttonFilters:Array = [buttonShadow];
		var myButton:MovieClip = this.createEmptyMovieClip("myButton"+String(buttonSeries)+String(i), this.getNextHighestDepth());
		myButton._x = offset+(posX*i);
		myButton._y = offset+posY;
		var fillType:String = "linear";
		var colors:Array = [color1, color2, color3, color4];
		var alphas:Array = [100, 100, 100, 100];
		var ratios:Array = [0, 126, 127, 255];
		var matrix:Object = {matrixType:"box", x:0, y:0, w:35, h:30, r:90/180*Math.PI};
		myButton.createEmptyMovieClip("buttonBkg", myButton.getNextHighestDepth());
		myButton.buttonBkg.lineStyle(0, lineColor, 60, true, "none", "square", "round");
		myButton.buttonBkg.beginGradientFill(fillType, colors, alphas, ratios, matrix);
		myButton.buttonBkg.lineTo(35, 0);
		myButton.buttonBkg.lineTo(35, 30);
		myButton.buttonBkg.lineTo(0, 30);
		myButton.buttonBkg.lineTo(0, 0);
		myButton.buttonBkg.endFill();
		var myFormat:TextFormat = new TextFormat();
		myFormat.align = "center";
		myFormat.font = "Tahoma";
		myFormat.size = 13;
		myFormat.color = labelColor;
		myButton.createTextField("labelText", myButton.getNextHighestDepth(), 0, 5, myButton._width, 24);
		myButton.labelText.text = labels[i];
		myButton.labelText.embedFonts = true;
		myButton.labelText.selectable = false;
		myButton.labelText.antiAliasType = "advanced";
		myButton.labelText.setTextFormat(myFormat);
		if (applyLabelFilter) {
			myButton.labelText.filters = labelFilters;
		}
		if (applyBkgFilter) {
			myButton.filters = buttonFilters;
		}
 
		myButton.onPress = function() {
			var currentArray:Array = eval("messages"+buttonSeries);
			var currentButtonNumber:Number = this._name.substr(-1, 1);
			Current = book.rightpage._currentframe;
 
			book.rightpage.gotoAndStop(Current + 2);
			book.leftpage.gotoAndStop(Current + 1);
			
			nextB = book.rightpage._currentframe + 1;
			prevB = book.leftpage._currentframe - 1;
			book.bl._visible = true;
			book.br._visible = true;
			trace("Went to:"+(Current));
		};
		
		
 
	}
 
}
for (var i:Number = 0; i<totalFrameCT; i++) {
	trace(i+1);
	labels.push(""+(i)+"-"+(i+1)+"");
	i++;
}
 
for (var i:Number = 0; i<totalFrameCT; i++) {
	var counts = i + 1;
	if (counts <= 5){
		Opos.push("" + i + "");
		trace(Opos);
		createButtons(2, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 38, 80, 0xFFFFFF, .40, 4, 3, false, true);
	}
}

Open in new window

0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24091810
Ok... I think thou I am seem to be moving a head I think I remeber now that

the button has to be in an array... does that sound right?
stop();
 
import flash.filters.GlowFilter;
 
import flash.filters.DropShadowFilter;
Current = book.rightpage._currentframe;
trace("Went to:"+(Current));
 
 
animation._visible = false;
 
 
alphaTween = new mx.transitions.Tween(copyright, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 3, true);
alphaTween = new mx.transitions.Tween(backgroundMC, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
alphaTween = new mx.transitions.Tween(book, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 0.75, true);
alphaTween = new mx.transitions.Tween(player, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
 
var labels:Array = [];
var Opos:Array = [];
var buttonPOS:Array = [];
var offset:Number = 10;
 
 
 
 
var totalFrameCT:Number = book.leftpage._totalframes;
 
 
 
function createButtons(buttonSeries:Number, color1:Number, color2:Number, color3:Number, color4:Number, lineColor:Number, labelColor:Number, numberOfButtons:Number, posX:Number, posY:Number, labelFilterColor:Number, labelFilterAlpha:Number, labelFilterBlur:Number, labelFilterStrength:Number, applyLabelFilter:Boolean, applyBkgFilter:Boolean) {
 
	for (var i:Number = 0; i<Opos.length; i++) {
 
		var labelGlow:GlowFilter = new GlowFilter(labelFilterColor, labelFilterAlpha, labelFilterBlur, labelFilterBlur, labelFilterStrength, 3);
		var labelFilters:Array = [labelGlow];
		var buttonShadow:DropShadowFilter = new DropShadowFilter(1, 45, 0x000000, 1, 4, 4, 1, 3);
		var buttonFilters:Array = [buttonShadow];
		var myButton:MovieClip = this.createEmptyMovieClip("myButton"+String(buttonSeries)+String(i), this.getNextHighestDepth());
		myButton._x = offset+(posX*i);
		myButton._y = offset+posY;
		var fillType:String = "linear";
		var colors:Array = [color1, color2, color3, color4];
		var alphas:Array = [100, 100, 100, 100];
		var ratios:Array = [0, 126, 127, 255];
		var matrix:Object = {matrixType:"box", x:0, y:0, w:35, h:30, r:90/180*Math.PI};
		myButton.createEmptyMovieClip("buttonBkg", myButton.getNextHighestDepth());
		myButton.buttonBkg.lineStyle(0, lineColor, 60, true, "none", "square", "round");
		myButton.buttonBkg.beginGradientFill(fillType, colors, alphas, ratios, matrix);
		myButton.buttonBkg.lineTo(35, 0);
		myButton.buttonBkg.lineTo(35, 30);
		myButton.buttonBkg.lineTo(0, 30);
		myButton.buttonBkg.lineTo(0, 0);
		myButton.buttonBkg.endFill();
		var myFormat:TextFormat = new TextFormat();
		myFormat.align = "center";
		myFormat.font = "Tahoma";
		myFormat.size = 13;
		myFormat.color = labelColor;
		myButton.createTextField("labelText", myButton.getNextHighestDepth(), 0, 5, myButton._width, 24);
		myButton.labelText.text = labels[i];
		myButton.labelText.embedFonts = true;
		myButton.labelText.selectable = false;
		myButton.labelText.antiAliasType = "advanced";
		myButton.labelText.setTextFormat(myFormat);
		if (applyLabelFilter) {
			myButton.labelText.filters = labelFilters;
		}
		if (applyBkgFilter) {
			myButton.filters = buttonFilters;
		}
 
		myButton.onPress = function() {
			var currentArray:Array = eval("messages"+buttonSeries);
			var currentButtonNumber:Number = this._name.substr(-1, 1);
			Current = book.rightpage._currentframe;
 
			book.rightpage.gotoAndStop(Current + 2);
			book.leftpage.gotoAndStop(Current + 1);
			
			nextB = Current + 1;
			prevB = Current - 1;
			book.bl._visible = true;
			book.br._visible = true;
			trace("Went to:"+(Current));
					onLABLES = labels[i].split("-");
		trace("Went to:"+(onLABLES[0]));
		buttonPOS = onLABLES[0];
		trace("Went to:"+buttonPOS);
		};
 
	}
 
}
for (var i:Number = 0; i<totalFrameCT; i++) {
	trace(i+1);
	labels.push(""+(i)+"-"+(i+1)+"");
	i++;
}
 
for (var i:Number = 0; i<totalFrameCT; i++) {
	var counts = i + 1;
	if (counts <= 5){
		Opos.push("" + i + "");
		trace(Opos);
		createButtons(1, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 38, 80, 0xFFFFFF, .40, 4, 3, false, true);
	}
}

Open in new window

0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24100112
Well, I'm a little farther now... I have cover button showing up but not the back button... still have not gotten passed the button just incrementing the pages where they should be going to.... I hope this is clear... I'm sure one can fallow the code here but It's starting to form the

start prev ... [11-12] [13-14] [15-16] ... next end


Any help here would be great... thank you...

Cheers
Jeremy
stop();
import flash.filters.GlowFilter;
import flash.filters.DropShadowFilter;
Current = book.rightpage._currentframe;
trace("Went to:"+(Current));
 
animation._visible = false;
 
alphaTween = new mx.transitions.Tween(copyright, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 3, true);
alphaTween = new mx.transitions.Tween(backgroundMC, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
alphaTween = new mx.transitions.Tween(book, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 0.75, true);
alphaTween = new mx.transitions.Tween(player, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
var labels:Array = [];
var Opos:Array = [];
var buttonPOS:Array = [];
var offset:Number = 10;
var spreads:Array = [];
 
var totalFrameCT:Number = book.leftpage._totalframes;
 
function createButtons(buttonSeries:Number, color1:Number, color2:Number, color3:Number, color4:Number, lineColor:Number, labelColor:Number, numberOfButtons:Number, posX:Number, posY:Number, labelFilterColor:Number, labelFilterAlpha:Number, labelFilterBlur:Number, labelFilterStrength:Number, applyLabelFilter:Boolean, applyBkgFilter:Boolean) {
 for (var i:Number = 0; i<Opos.length; i++) {
  var labelGlow:GlowFilter = new GlowFilter(labelFilterColor, labelFilterAlpha, labelFilterBlur, labelFilterBlur, labelFilterStrength, 3);
  var labelFilters:Array = [labelGlow];
  var buttonShadow:DropShadowFilter = new DropShadowFilter(1, 45, 0x000000, 1, 4, 4, 1, 3);
  var buttonFilters:Array = [buttonShadow];
  var myButton:MovieClip = this.createEmptyMovieClip("myButton"+String(buttonSeries)+String(i), this.getNextHighestDepth());
  myButton._x = offset+(posX*i);
  myButton._y = offset+posY;
  var fillType:String = "linear";
  var colors:Array = [color1, color2, color3, color4];
  var alphas:Array = [100, 100, 100, 100];
  var ratios:Array = [0, 126, 127, 255];
  var matrix:Object = {matrixType:"box", x:0, y:0, w:35, h:30, r:90/180*Math.PI};
  myButton.createEmptyMovieClip("buttonBkg", myButton.getNextHighestDepth());
  myButton.buttonBkg.lineStyle(0, lineColor, 60, true, "none", "square", "round");
  myButton.buttonBkg.beginGradientFill(fillType, colors, alphas, ratios, matrix);
  myButton.buttonBkg.lineTo(35, 0);
  myButton.buttonBkg.lineTo(35, 30);
  myButton.buttonBkg.lineTo(0, 30);
  myButton.buttonBkg.lineTo(0, 0);
  myButton.buttonBkg.endFill();
  var myFormat:TextFormat = new TextFormat();
  myFormat.align = "center";
  myFormat.font = "Tahoma";
  myFormat.size = 13;
  myFormat.color = labelColor;
  myButton.createTextField("labelText", myButton.getNextHighestDepth(), 0, 5, myButton._width, 24);
  myButton.labelText.text = labels[i];
  myButton.labelText.embedFonts = true;
  myButton.labelText.selectable = false;
  myButton.labelText.antiAliasType = "advanced";
  myButton.labelText.setTextFormat(myFormat);
  if (applyLabelFilter) {
   myButton.labelText.filters = labelFilters;
  }
  if (applyBkgFilter) {
   myButton.filters = buttonFilters;
  }
  myButton.onPress = function() {
   var currentArray:Array = eval("messages"+buttonSeries);
   var currentButtonNumber:Number = this._name.substr(-1, 1);
   Current = book.rightpage._currentframe;
   book.rightpage.gotoAndStop(Current + 2);
   book.leftpage.gotoAndStop(Current + 1);
   
   nextB = Current + 1;
   prevB = Current - 1;
   book.bl._visible = true;
   book.br._visible = true;
   trace("Went to:"+(Current));
     onLABLES = spreads[i].split("-");
  trace("Went to:"+(onLABLES[0]));
  buttonPOS = onLABLES[0];
  trace("Went to:"+buttonPOS);
  };
 }
}
for (var i:Number = 0; i<totalFrameCT; i++) {
 trace(i+1);
 
 if (i == "0"){
  labels.push("Cover");
  }else if ((i+1) == (totalFrameCT)) {
   labels.push("Back");
  }else {
   labels.push(""+(i)+"-"+(i+1)+"");
  }
 spreads.push(""+(i)+"-"+(i+1)+"");
 i++;
}
for (var i:Number = 0; i<spreads.length; i++) {
 var counts = i + 1;
 if (counts < "5"){
  Opos.push("" + i + "");
  trace(Opos);
  createButtons(1, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 38, 80, 0xFFFFFF, .40, 4, 3, false, true);
 }
}
testPRINT.onPress = function() {PrintScreenShot();};
 
function PrintScreenShot (target:MovieClip)
                {
                                //snapShot(target);
 
                                _screenshot_mc = _root.createEmptyMovieClip ( "screenshot_mc" , _global._depth++ );
                                _screenshot = new BitmapData(target._width, target._height, _bTransparent, _bgColor);
                                _screenshot.draw(target);
                                _screenshot_mc.attachBitmap (_screenshot ,_global._depth++);
 
                                var topLeft          = 0;
                                var topRight       = _screenshot_mc._width;
                                var bottomLeft = 0;
                                var bottomRight               = _screenshot_mc._height;
 
                                _printJob = new PrintJob ();
 
                                if ( _printJob.start () )
                                {
                                                if ( _printJob.addPage( _screenshot_mc , { xMin:topLeft , xMax:topRight , yMin:bottomLeft , yMax:bottomRight } , { printAsBitmap:true } ) )
                                                {
                                                                _printJob.send ();
                                                }
                                }
 
                                delete _printJob;
                                
                                //you should enable these 2 lines, I left them so that you can see a preview of what will be printed
                                //_root.removeMovieClip( "screenshot_mc" );
                                //_screenshot.dispose ();
                }

Open in new window

0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24110420
Little by little I'm closer now...

I have the start last button showing up and going to the correct area... but now the [2-3] buttons are not going to there area, only on the last var i... two forward one back...

Any help here would be great... thank you for the help....

Jeremy


Note now commented... may-be that will help...

stop();
 
import flash.filters.GlowFilter;
 
import flash.filters.DropShadowFilter;
var Current:Number = book.rightpage._currentframe;
trace("Went to:"+(Current));
 
 
animation._visible = false;
 
 
alphaTween = new mx.transitions.Tween(copyright, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 3, true);
alphaTween = new mx.transitions.Tween(backgroundMC, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
alphaTween = new mx.transitions.Tween(book, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 0.75, true);
alphaTween = new mx.transitions.Tween(player, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
 
var labels:Array = [];
var Opos:Array = [];
var buttonPOS:Array = [];
var offset:Number = 10;
var spreads:Array = [];
 
 
/////////////////
/// setting total frames (pages)
/////////////////
var totalFrameCT:Number = book.leftpage._totalframes;
 
iseven = ((totalFrameCT & 1) == 0)
 
function createButtons(ButtonType:Number, color1:Number, color2:Number, color3:Number, color4:Number, lineColor:Number, labelColor:Number, numberOfButtons:Number, posX:Number, posY:Number, labelFilterColor:Number, labelFilterAlpha:Number, labelFilterBlur:Number, labelFilterStrength:Number, applyLabelFilter:Boolean, applyBkgFilter:Boolean, nameOverRide:String) {
 
	for (var i:Number = 0; i<ButtonType; i++) {
		
		/////////////////
		/// bumping past the cover area... 
		/////////////////
			if (nameOverRide == ""){
			var counts = i + 1; 
				if (counts <= 1){
					i++;
				}
			}
		var labelGlow:GlowFilter = new GlowFilter(labelFilterColor, labelFilterAlpha, labelFilterBlur, labelFilterBlur, labelFilterStrength, 3);
		var labelFilters:Array = [labelGlow];
		var buttonShadow:DropShadowFilter = new DropShadowFilter(1, 45, 0x000000, 1, 4, 4, 1, 3);
		var buttonFilters:Array = [buttonShadow];
		var myButton:MovieClip = this.createEmptyMovieClip("myButton"+String(i), this.getNextHighestDepth());
 
		/////////////////
		/// Setting pos 
		/////////////////
			if (nameOverRide == "Back"){
				myButton._x = posX;
			}else{
				myButton._x = offset+(posX*i);
			}
		
		
		
		myButton._y = offset+posY;
		var fillType:String = "linear";
		var colors:Array = [color1, color2, color3, color4];
		var alphas:Array = [100, 100, 100, 100];
		var ratios:Array = [0, 126, 127, 255];
		var matrix:Object = {matrixType:"box", x:0, y:0, w:40, h:30, r:90/180*Math.PI};
		myButton.createEmptyMovieClip("buttonBkg", myButton.getNextHighestDepth());
		myButton.buttonBkg.lineStyle(0, lineColor, 60, true, "none", "square", "round");
		myButton.buttonBkg.beginGradientFill(fillType, colors, alphas, ratios, matrix);
		myButton.buttonBkg.lineTo(40, 0);
		myButton.buttonBkg.lineTo(40, 30);
		myButton.buttonBkg.lineTo(0, 30);
		myButton.buttonBkg.lineTo(0, 0);
		myButton.buttonBkg.endFill();
		var myFormat:TextFormat = new TextFormat();
		myFormat.align = "center";
		myFormat.font = "Tahoma";
		myFormat.size = 13;
		myFormat.color = labelColor;
		myButton.createTextField("labelText", myButton.getNextHighestDepth(), 0, 5, myButton._width, 24);
		/////////////////
		/// lableing the buttons 
		/////////////////		
			if (nameOverRide != ""){
				myButton.labelText.text = nameOverRide;
			}else{
				myButton.labelText.text = labels[i];
			}
			
		
		myButton.labelText.embedFonts = true;
		myButton.labelText.selectable = false;
		myButton.labelText.antiAliasType = "advanced";
		myButton.labelText.setTextFormat(myFormat);
			if (applyLabelFilter) {
				myButton.labelText.filters = labelFilters;
			}
			if (applyBkgFilter) {
				myButton.filters = buttonFilters;
			}
 
		myButton.onPress = function() {
			//var currentArray:Array = eval("messages"+buttonSeries);
			var currentButtonNumber:Number = this._name.substr(-1, 1);
			Current = book.rightpage._currentframe;
 
		/////////////////
		/// seeting destaination of the buttons 
		/////////////////					
			if (nameOverRide == "Back"){
	
				if (iseven == true){
					book.rightpage.gotoAndStop(totalFrameCT);
					book.leftpage.gotoAndStop(totalFrameCT-1);
					trace("Went to:"+totalFrameCT+"-"+(totalFrameCT-1)+" (Back for even)");
				}else{
					book.rightpage.gotoAndStop(totalFrameCT+1);
					book.leftpage.gotoAndStop(totalFrameCT);
					trace("Went to:"+(totalFrameCT+1)+"-"+totalFrameCT+" (Back for odd)");
				}
				
				
				
			}else if (nameOverRide == "Cover"){
				book.rightpage.gotoAndStop(2);
				book.leftpage.gotoAndStop(1);
				trace("Went to:"+0+"-"+1+" (COVER)");
			}else{
				onLABLES = labels[i].split("-");
				book.rightpage.gotoAndStop(onLABLES[0]);
				book.leftpage.gotoAndStop(onLABLES[1]);
				trace("Went to:"+onLABLES[0]+"-"+onLABLES[1]);
			}
			
			
			
 
			
			nextB = Current + 1;
			prevB = Current - 1;
			book.bl._visible = true;
			book.br._visible = true;
			trace("Went to:"+(Current));
					onLABLES = spreads[i].split("-");
					trace("Went to:"+(onLABLES[0]));
					buttonPOS = onLABLES[0];
					trace("Went to:"+buttonPOS);
		};
 
	}
 
}
 
 
/////////////////
/// setting lables and spreads
/////////////////
 
for (var i:Number = 0; i<totalFrameCT; i++) {
	trace(i+1);
	
 
	labels.push(""+(i)+"-"+(i+1)+"");
 
	spreads.push(""+(i)+"-"+(i+1)+"");
	i++;
}
 
/////////////////
/// Buttons
/////////////////
 
 
//// start
createButtons(1, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 43, 80, 0xFFFFFF, .40, 4, 3, false, true, "Cover");
 
//// spread buttons
createButtons(4, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 43, 80, 0xFFFFFF, .40, 4, 3, false, true, "");
 
//// end
createButtons(1, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 182, 80, 0xFFFFFF, .40, 4, 3, false, true, "Back");
 
 
////////printing button
testPRINT.onPress = function() {
      var pj = new PrintJob();
      var success = pj.start();
      if (success)
      {
            pj.addPage(0, {xMin:0, xMax:400, yMin:0, yMax:500});
            pj.addPage("book.rightpage", {xMin:-300, xMax:300, yMin:400, yMax:800});
            pj.send();
      }
      delete pj;
};

Open in new window

0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24112088
Ok... as I keep going here... I tried breaking out the buttons to hopfully get out of the thumb of the var i loop... as I've only been getting the last value... so the button function is out but the onPress is not... sighs.. I just need to get this to work lol...

Here is where I am...
stop();
 
import flash.filters.GlowFilter;
 
import flash.filters.DropShadowFilter;
 
var curLeft:Number = book.leftpage._currentframe;
var curRight:Number = book.rightpage._currentframe;
 
var Current:Number = book.rightpage._currentframe;
trace("Went to:"+(Current));
 
 
animation._visible = false;
 
 
alphaTween = new mx.transitions.Tween(copyright, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 3, true);
alphaTween = new mx.transitions.Tween(backgroundMC, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
alphaTween = new mx.transitions.Tween(book, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 0.75, true);
alphaTween = new mx.transitions.Tween(player, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
 
var labels:Array = [];
var Opos:Array = [];
var buttonPOS:Array = [];
var offset:Number = 10;
var spreads:Array = [];
var iNum:Number = 0;
/////////////////
/// setting total frames (pages)
/////////////////
var totalFrameCT:Number = book.leftpage._totalframes;
 
iseven = ((totalFrameCT & 1) == 0)
 
function createButtons(ButtonType:Number, color1:Number, color2:Number, color3:Number, color4:Number, lineColor:Number, labelColor:Number, numberOfButtons:Number, posX:Number, posY:Number, labelFilterColor:Number, labelFilterAlpha:Number, labelFilterBlur:Number, labelFilterStrength:Number, applyLabelFilter:Boolean, applyBkgFilter:Boolean, nameOverRide:String) {
trace(curLeft);
		/////////////////
		/// trying to set the current
		/////////////////	
if (iseven == true){
			if (curLeft == 1){
				var opy:Number = 1; 
				trace(opy + "iseven == true  curLeft == 1");
			}else if ((curLeft != 1) && (curLeft >= 3) && (curLeft <= (totalFrameCT - 3))) {
				var opy:Number = curLeft;
				trace(opy + "");
			}
			
}else {
	
			if (curLeft == 1){
				var opy:Number = 1; 
				trace(opy + "");
			}else if ((curLeft != 1) && (curLeft >= 3) && (curLeft <= (totalFrameCT - 4))) {
				var opy:Number = curLeft;
				trace(opy + "");
			}
}
			trace(opy);
			
			
			
	for (var i:Number = opy - 1; i<ButtonType; i++) {
		
		/////////////////
		/// bumping past the cover area... 
		/////////////////
			if (nameOverRide == ""){
			var counts = i + 1; 
				if (counts <= 1){
					i++;
				}
			}
		var labelGlow:GlowFilter = new GlowFilter(labelFilterColor, labelFilterAlpha, labelFilterBlur, labelFilterBlur, labelFilterStrength, 3);
		var labelFilters:Array = [labelGlow];
		var buttonShadow:DropShadowFilter = new DropShadowFilter(1, 45, 0x000000, 1, 4, 4, 1, 3);
		var buttonFilters:Array = [buttonShadow];
		var myButton:MovieClip = this.createEmptyMovieClip("myButton"+String(i), this.getNextHighestDepth());
 
		/////////////////
		/// Setting pos 
		/////////////////
			if (nameOverRide == "Back"){
				myButton._x = posX;
			}else{
				myButton._x = offset+(posX*i);
			}
		
		
		
		myButton._y = offset+posY;
		var fillType:String = "linear";
		var colors:Array = [color1, color2, color3, color4];
		var alphas:Array = [100, 100, 100, 100];
		var ratios:Array = [0, 126, 127, 255];
		var matrix:Object = {matrixType:"box", x:0, y:0, w:40, h:30, r:90/180*Math.PI};
		myButton.createEmptyMovieClip("buttonBkg", myButton.getNextHighestDepth());
		myButton.buttonBkg.lineStyle(0, lineColor, 60, true, "none", "square", "round");
		myButton.buttonBkg.beginGradientFill(fillType, colors, alphas, ratios, matrix);
		myButton.buttonBkg.lineTo(40, 0);
		myButton.buttonBkg.lineTo(40, 30);
		myButton.buttonBkg.lineTo(0, 30);
		myButton.buttonBkg.lineTo(0, 0);
		myButton.buttonBkg.endFill();
		var myFormat:TextFormat = new TextFormat();
		myFormat.align = "center";
		myFormat.font = "Tahoma";
		myFormat.size = 13;
		myFormat.color = labelColor;
		myButton.createTextField("labelText", myButton.getNextHighestDepth(), 0, 5, myButton._width, 24);
		/////////////////
		/// lableing the buttons 
		/////////////////		
			if (nameOverRide != ""){
				myButton.labelText.text = nameOverRide;
			}else{
				myButton.labelText.text = labels[i];
			}
			
		var iNum = i;
		myButton.labelText.embedFonts = true;
		myButton.labelText.selectable = false;
		myButton.labelText.antiAliasType = "advanced";
		myButton.labelText.setTextFormat(myFormat);
			if (applyLabelFilter) {
				myButton.labelText.filters = labelFilters;
			}
			if (applyBkgFilter) {
				myButton.filters = buttonFilters;
			}
			
		/////////////////
		/// setting buttons happenings
		/////////////////			
		myButton.onPress = function() {
			btnWhataToDo(iNum, nameOverRide);
		};
 
 
	}
 
}
		/////////////////
		/// setting the buttons function
		/////////////////	
function btnWhataToDo (iNum:Number, nameOverRide:String)
                {
			trace (iNum)
			//var currentArray:Array = eval("messages"+buttonSeries);
			var currentButtonNumber:Number = this._name.substr(-1, 1);
			Current = book.rightpage._currentframe;
 
		/////////////////
		/// seeting destaination of the buttons 
		/////////////////					
			if (nameOverRide == "Back"){
	
				if (iseven == true){
					book.rightpage.gotoAndStop(totalFrameCT);
					book.leftpage.gotoAndStop(totalFrameCT-1);
					trace("Went to:"+totalFrameCT+"-"+(totalFrameCT-1)+" (Back for even)");
				}else{
					book.rightpage.gotoAndStop(totalFrameCT+1);
					book.leftpage.gotoAndStop(totalFrameCT);
					trace("Went to:"+(totalFrameCT+1)+"-"+totalFrameCT+" (Back for odd)");
				}
				
				
				
			}else if (nameOverRide == "Cover"){
				book.rightpage.gotoAndStop(2);
				book.leftpage.gotoAndStop(1);
				trace("Went to:"+0+"-"+1+" (COVER)");
			}else{
//				var onLABLES:Array = labels[i].split("-");
//				var right:Number = (onLABLES[0]-(-1));
//				var left:Number = (onLABLES[1]-(-1));
				book.rightpage.gotoAndStop(curRight + iNum + 1);
				book.leftpage.gotoAndStop(curLeft + iNum);
//				trace("Went to:"+right+"-"+left);
			}
		
			nextB = Current + 1;
			prevB = Current - 1;
			book.bl._visible = true;
			book.br._visible = true;
}
 
/////////////////
/// setting lables and spreads
/////////////////
 
for (var i:Number = 0; i<totalFrameCT; i++) {
	trace(i+1);
	
 
	labels.push(""+(i)+"-"+(i+1)+"");
 
	spreads.push(""+(i)+"-"+(i+1)+"");
	i++;
}
 
/////////////////
/// Buttons
/////////////////
 
 
//// start
createButtons(1, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 43, 80, 0xFFFFFF, .40, 4, 3, false, true, "Cover");
 
//// spread buttons
createButtons(4, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 43, 80, 0xFFFFFF, .40, 4, 3, false, true, "");
 
//// end
createButtons(1, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 182, 80, 0xFFFFFF, .40, 4, 3, false, true, "Back");
 
 
////////printing button
testPRINT.onPress = function() {
      var pj = new PrintJob();
      var success = pj.start();
      if (success)
      {
            pj.addPage(0, {xMin:0, xMax:400, yMin:0, yMax:500});
            pj.addPage("book.rightpage", {xMin:-300, xMax:300, yMin:400, yMax:800});
            pj.send();
      }
      delete pj;
};

Open in new window

0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24113399
So I'm try it a little different here... I'm setting all the buttons at once... and then going to mask off the extra... I think that may make it easier to do...


Here is were I'm at...
stop();
 
import flash.filters.GlowFilter;
 
import flash.filters.DropShadowFilter;
 
var curLeft:Number = book.leftpage._currentframe;
var curRight:Number = book.rightpage._currentframe;
 
var Current:Number = book.rightpage._currentframe;
trace("Went to:"+(Current));
 
 
animation._visible = false;
 
 
alphaTween = new mx.transitions.Tween(copyright, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 3, true);
alphaTween = new mx.transitions.Tween(backgroundMC, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
alphaTween = new mx.transitions.Tween(book, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 0.75, true);
alphaTween = new mx.transitions.Tween(player, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
 
var labels:Array = [];
var Opos:Array = [];
var buttonPOS:Array = [];
var offset:Number = 10;
var spreads:Array = [];
var iNum:Number = 0;
/////////////////
/// setting total frames (pages)
/////////////////
var totalFrameCT:Number = book.leftpage._totalframes;
 
iseven = ((totalFrameCT & 1) == 0)
//trace(curLeft);
  /////////////////
  /// trying to set the current
  ///////////////// 
if (iseven == true){
   if (curLeft == 1){
    var opy:Number = 1; 
    //trace(opy + "iseven == true  curLeft == 1");
   }else if ((curLeft != 1) && (curLeft >= 3) && (curLeft <= (totalFrameCT - 3))) {
    var opy:Number = curLeft;
    //trace(opy + "");
   }
   
}else {
 
   if (curLeft == 1){
    var opy:Number = 1; 
    //trace(opy + "");
   }else if ((curLeft != 1) && (curLeft >= 3) && (curLeft <= (totalFrameCT - 4))) {
    var opy:Number = curLeft;
    //trace(opy + "");
   }
}
   //trace(opy);
function createButtons(ButtonType:Number, color1:Number, color2:Number, color3:Number, color4:Number, lineColor:Number, labelColor:Number, numberOfButtons:Number, posX:Number, posY:Number, labelFilterColor:Number, labelFilterAlpha:Number, labelFilterBlur:Number, labelFilterStrength:Number, applyLabelFilter:Boolean, applyBkgFilter:Boolean, nameOverRide:String) {
 
   
   
   
 for (var i:Number = opy - 1; i<ButtonType; i++) {
  
  /////////////////
  /// bumping past the cover area... 
  /////////////////
   if (nameOverRide == ""){
   var counts = i + 1; 
    if (counts <= 1){
     i++;
    }
   }
  var labelGlow:GlowFilter = new GlowFilter(labelFilterColor, labelFilterAlpha, labelFilterBlur, labelFilterBlur, labelFilterStrength, 3);
  var labelFilters:Array = [labelGlow];
  var buttonShadow:DropShadowFilter = new DropShadowFilter(1, 45, 0x000000, 1, 4, 4, 1, 3);
  var buttonFilters:Array = [buttonShadow];
  var myButton:MovieClip = this.createEmptyMovieClip("myButton"+String(i), this.getNextHighestDepth());
 
  /////////////////
  /// Setting pos 
  /////////////////
   if (nameOverRide == "Back"){
    myButton._x = posX;
   }else{
    myButton._x = offset+(posX*i);
   }
  
  
  
  myButton._y = offset+posY;
  var fillType:String = "linear";
  var colors:Array = [color1, color2, color3, color4];
  var alphas:Array = [100, 100, 100, 100];
  var ratios:Array = [0, 126, 127, 255];
  var matrix:Object = {matrixType:"box", x:0, y:0, w:40, h:30, r:90/180*Math.PI};
  myButton.createEmptyMovieClip("buttonBkg", myButton.getNextHighestDepth());
  myButton.buttonBkg.lineStyle(0, lineColor, 60, true, "none", "square", "round");
  myButton.buttonBkg.beginGradientFill(fillType, colors, alphas, ratios, matrix);
  myButton.buttonBkg.lineTo(40, 0);
  myButton.buttonBkg.lineTo(40, 30);
  myButton.buttonBkg.lineTo(0, 30);
  myButton.buttonBkg.lineTo(0, 0);
  myButton.buttonBkg.endFill();
  var myFormat:TextFormat = new TextFormat();
  myFormat.align = "center";
  myFormat.font = "Tahoma";
  myFormat.size = 13;
  myFormat.color = labelColor;
  myButton.createTextField("labelText", myButton.getNextHighestDepth(), 0, 5, myButton._width, 24);
  /////////////////
  /// lableing the buttons 
  /////////////////  
   if (nameOverRide != ""){
    myButton.labelText.text = nameOverRide;
   }else{
    myButton.labelText.text = labels[i];
   }
   
 
  myButton.labelText.embedFonts = true;
  myButton.labelText.selectable = false;
  myButton.labelText.antiAliasType = "advanced";
  myButton.labelText.setTextFormat(myFormat);
   if (applyLabelFilter) {
    myButton.labelText.filters = labelFilters;
   }
   if (applyBkgFilter) {
    myButton.filters = buttonFilters;
   }
   
  /////////////////
  /// setting buttons happenings
  /////////////////   
  var iNum = i;
  myButton.onPress = function() {
   btnWhataToDo(iNum, nameOverRide);
  };
 
 
 }
 
}
  /////////////////
  /// setting the buttons function
  ///////////////// 
function btnWhataToDo (iNum:Number, nameOverRide:String)
                {
   trace (iNum)
   //var currentArray:Array = eval("messages"+buttonSeries);
   var currentButtonNumber:Number = this._name.substr(-1, 1);
   Current = book.rightpage._currentframe;
 
  /////////////////
  /// seeting destaination of the buttons 
  /////////////////     
   if (nameOverRide == "Back"){
 
    if (iseven == true){
     book.rightpage.gotoAndStop(totalFrameCT);
     book.leftpage.gotoAndStop(totalFrameCT-1);
     //trace("Went to:"+totalFrameCT+"-"+(totalFrameCT-1)+" (Back for even)");
    }else{
     book.rightpage.gotoAndStop(totalFrameCT+1);
     book.leftpage.gotoAndStop(totalFrameCT);
     //trace("Went to:"+(totalFrameCT+1)+"-"+totalFrameCT+" (Back for odd)");
    }
    
    
    
   }else if (nameOverRide == "Cover"){
    book.rightpage.gotoAndStop(2);
    book.leftpage.gotoAndStop(1);
    trace("Went to:"+0+"-"+1+" (COVER)");
   }else{
//    var onLABLES:Array = labels[i].split("-");
//    var right:Number = (onLABLES[0]-(-1));
//    var left:Number = (onLABLES[1]-(-1));
    book.rightpage.gotoAndStop(curRight + iNum);
    book.leftpage.gotoAndStop(curLeft + iNum - 1);
//    trace("Went to:"+right+"-"+left);
   }
  
   nextB = Current + 1;
   prevB = Current - 1;
   book.bl._visible = true;
   book.br._visible = true;
}
 
/////////////////
/// setting lables and spreads
/////////////////
 
for (var i:Number = 0; i<totalFrameCT; i++) {
 trace(i+1);
 
 
 labels.push(""+(i)+"-"+(i+1)+"");
 
 spreads.push(""+(i)+"-"+(i+1)+"");
 i++;
}
 
/////////////////
/// Buttons
/////////////////
 
 
//// start
createButtons(1, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 43, 80, 0xFFFFFF, .40, 4, 3, false, true, "Cover");
 
 
 
//// spread buttons
 
function createMask() {
 
_root.createEmptyMovieClip("mask_mc",_root.getNextHighestDepth());
 
mask_mc._x = 43;
mask_mc._y = 80;
 
mask_mc.beginFill(0x000000,100);
 
  mask_mc.lineTo(40, 0);
  mask_mc.lineTo(40, 30);
  mask_mc.lineTo(0, 30);
  mask_mc.lineTo(0, 0);
myButton.setMask(mask_mc);
 
}
createButtons(labels.length-2, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 43, 80, 0xFFFFFF, .40, 4, 3, false, true, "");
createMask();
 
 
 
//// end
createButtons(1, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 182, 80, 0xFFFFFF, .40, 4, 3, false, true, "Back");
 
 
////////printing button
testPRINT.onPress = function() {
      var pj = new PrintJob();
      var success = pj.start();
      if (success)
      {
            pj.addPage(0, {xMin:0, xMax:400, yMin:0, yMax:500});
            pj.addPage("book.rightpage", {xMin:-300, xMax:300, yMin:400, yMax:800});
            pj.send();
      }
      delete pj;
};

Open in new window

0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24113479
ok... so the masking it producing mix results... it's mostly working... but it's masking one by one... so I'd think..?? I'd have to push all the spread buttons to a mc ??

Again any help here would be greatly appreciated... thank you...

stop();
 import mx.transitions.Tween;
import mx.transitions.easing.*;
import flash.filters.GlowFilter;
 
import flash.filters.DropShadowFilter;
 
var curLeft:Number = book.leftpage._currentframe;
var curRight:Number = book.rightpage._currentframe;
 
var Current:Number = book.rightpage._currentframe;
trace("Went to:"+(Current));
 
 
animation._visible = false;
 
 
alphaTween = new mx.transitions.Tween(copyright, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 3, true);
alphaTween = new mx.transitions.Tween(backgroundMC, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
alphaTween = new mx.transitions.Tween(book, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 0.75, true);
alphaTween = new mx.transitions.Tween(player, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
 
var labels:Array = [];
var Opos:Array = [];
var buttonPOS:Array = [];
var offset:Number = 10;
var spreads:Array = [];
var iNum:Number = 0;
/////////////////
/// setting total frames (pages)
/////////////////
var totalFrameCT:Number = book.leftpage._totalframes;
 
iseven = ((totalFrameCT & 1) == 0)
//trace(curLeft);
  /////////////////
  /// trying to set the current
  ///////////////// 
if (iseven == true){
   if (curLeft == 1){
    var opy:Number = 1; 
    //trace(opy + "iseven == true  curLeft == 1");
   }else if ((curLeft != 1) && (curLeft >= 3) && (curLeft <= (totalFrameCT - 3))) {
    var opy:Number = curLeft;
    //trace(opy + "");
   }
   
}else {
 
   if (curLeft == 1){
    var opy:Number = 1; 
    //trace(opy + "");
   }else if ((curLeft != 1) && (curLeft >= 3) && (curLeft <= (totalFrameCT - 4))) {
    var opy:Number = curLeft;
    //trace(opy + "");
   }
}
   //trace(opy);
function createButtons(ButtonType:Number, color1:Number, color2:Number, color3:Number, color4:Number, lineColor:Number, labelColor:Number, numberOfButtons:Number, posX:Number, posY:Number, labelFilterColor:Number, labelFilterAlpha:Number, labelFilterBlur:Number, labelFilterStrength:Number, applyLabelFilter:Boolean, applyBkgFilter:Boolean, nameOverRide:String) {
 
   
   
   
 for (var i:Number = opy - 1; i<ButtonType; i++) {
  
  /////////////////
  /// bumping past the cover area... 
  /////////////////
   if (nameOverRide == ""){
   var counts = i + 1; 
    if (counts <= 1){
     i++;
    }
   }
  var labelGlow:GlowFilter = new GlowFilter(labelFilterColor, labelFilterAlpha, labelFilterBlur, labelFilterBlur, labelFilterStrength, 3);
  var labelFilters:Array = [labelGlow];
  var buttonShadow:DropShadowFilter = new DropShadowFilter(1, 45, 0x000000, 1, 4, 4, 1, 3);
  var buttonFilters:Array = [buttonShadow];
  var myButton:MovieClip = this.createEmptyMovieClip("myButton"+String(i), this.getNextHighestDepth());
 
  /////////////////
  /// Setting pos 
  /////////////////
   if (nameOverRide == "Back"){
    myButton._x = posX;
   }else{
    myButton._x = offset+(posX*i);
   }
  
  
  
  myButton._y = offset+posY;
  var fillType:String = "linear";
  var colors:Array = [color1, color2, color3, color4];
  var alphas:Array = [100, 100, 100, 100];
  var ratios:Array = [0, 126, 127, 255];
  var matrix:Object = {matrixType:"box", x:0, y:0, w:40, h:30, r:90/180*Math.PI};
  myButton.createEmptyMovieClip("buttonBkg", myButton.getNextHighestDepth());
  myButton.buttonBkg.lineStyle(0, lineColor, 60, true, "none", "square", "round");
  myButton.buttonBkg.beginGradientFill(fillType, colors, alphas, ratios, matrix);
  myButton.buttonBkg.lineTo(40, 0);
  myButton.buttonBkg.lineTo(40, 30);
  myButton.buttonBkg.lineTo(0, 30);
  myButton.buttonBkg.lineTo(0, 0);
  myButton.buttonBkg.endFill();
  var myFormat:TextFormat = new TextFormat();
  myFormat.align = "center";
  myFormat.font = "Tahoma";
  myFormat.size = 13;
  myFormat.color = labelColor;
  myButton.createTextField("labelText", myButton.getNextHighestDepth(), 0, 5, myButton._width, 24);
  /////////////////
  /// lableing the buttons 
  /////////////////  
   if (nameOverRide != ""){
    myButton.labelText.text = nameOverRide;
   }else{
    myButton.labelText.text = labels[i];
   }
   
 
  myButton.labelText.embedFonts = true;
  myButton.labelText.selectable = false;
  myButton.labelText.antiAliasType = "advanced";
  myButton.labelText.setTextFormat(myFormat);
   if (applyLabelFilter) {
    myButton.labelText.filters = labelFilters;
   }
   if (applyBkgFilter) {
    myButton.filters = buttonFilters;
   }
 
///set mask for buttons
 
  var maskClip:MovieClip = myButton.createEmptyMovieClip("mask_mc", 20);
    with (maskClip) {
        // Draw a mask that is the same size as the loaded image.
        beginFill(0xFF00FF, 100);
        moveTo(0, 0);
        lineTo(40, 0);
        lineTo(40, 30);
        lineTo(0, 30);
        lineTo(0, 0);
        endFill();
    }
    myButton.setMask(maskClip);
var mask_tween:Tween = new Tween(maskClip, "_yscale", Strong.easeOut, 0, 100, 2, true);  
mask_tween.onMotionFinished = function (){
maskClip.removeMovieClip();
}
 
  /////////////////
  /// setting buttons happenings
  /////////////////   
  var iNum = i;
  myButton.onPress = function() {
   btnWhataToDo(iNum, nameOverRide);
  };
 
 
 }
 
}
///remove mask for button use
mask_tween.onMotionFinished = function (){
maskClip.removeMovieClip();
}
  /////////////////
  /// setting the buttons function
  ///////////////// 
function btnWhataToDo (iNum:Number, nameOverRide:String)
                {
   trace (iNum)
   //var currentArray:Array = eval("messages"+buttonSeries);
   var currentButtonNumber:Number = this._name.substr(-1, 1);
   Current = book.rightpage._currentframe;
 
  /////////////////
  /// seeting destaination of the buttons 
  /////////////////     
   if (nameOverRide == "Back"){
 
    if (iseven == true){
     book.rightpage.gotoAndStop(totalFrameCT);
     book.leftpage.gotoAndStop(totalFrameCT-1);
     //trace("Went to:"+totalFrameCT+"-"+(totalFrameCT-1)+" (Back for even)");
    }else{
     book.rightpage.gotoAndStop(totalFrameCT+1);
     book.leftpage.gotoAndStop(totalFrameCT);
     //trace("Went to:"+(totalFrameCT+1)+"-"+totalFrameCT+" (Back for odd)");
    }
    
    
    
   }else if (nameOverRide == "Cover"){
    book.rightpage.gotoAndStop(2);
    book.leftpage.gotoAndStop(1);
    trace("Went to:"+0+"-"+1+" (COVER)");
   }else{
//    var onLABLES:Array = labels[i].split("-");
//    var right:Number = (onLABLES[0]-(-1));
//    var left:Number = (onLABLES[1]-(-1));
    book.rightpage.gotoAndStop(curRight + iNum);
    book.leftpage.gotoAndStop(curLeft + iNum - 1);
//    trace("Went to:"+right+"-"+left);
   }
  
   nextB = Current + 1;
   prevB = Current - 1;
   book.bl._visible = true;
   book.br._visible = true;
   
   
 
   
}
 
/////////////////
/// setting lables and spreads
/////////////////
 
for (var i:Number = 0; i<totalFrameCT; i++) {
 trace(i+1);
 
 
 labels.push(""+(i)+"-"+(i+1)+"");
 
 spreads.push(""+(i)+"-"+(i+1)+"");
 i++;
}
 
/////////////////
/// Buttons
/////////////////
 
 
 
 
 
 
 
 
 
 
//// spread buttons
 
 
createButtons(labels.length-2, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 43, 80, 0xFFFFFF, .40, 4, 3, true, true, "");
//// start
createButtons(1, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 43, 80, 0xFFFFFF, .40, 4, 3, true, true, "Cover");
 
 
//// end
createButtons(1, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 182, 80, 0xFFFFFF, .40, 4, 3, true, true, "Back"); 
 
////////printing button
testPRINT.onPress = function() {
      var pj = new PrintJob();
      var success = pj.start();
      if (success)
      {
            pj.addPage(0, {xMin:0, xMax:400, yMin:0, yMax:500});
            pj.addPage("book.rightpage", {xMin:-300, xMax:300, yMin:400, yMax:800});
            pj.send();
      }
      delete pj;
};

Open in new window

0
 
LVL 39

Expert Comment

by:blue-genie
ID: 24113520
hey sorry i'm in the middle of the bush on holiday just logged in to check my mails, i'm back on monday - will only be able to have a look then.
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24113531
That's cool... I'm still pluging away... I'm running short of time so I'm hoping to get it... but so far.. :) well I'm still trying...

Thank you for getting back...

Cheers
Jeremy
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 24129036
ok i'm back. upload me what you have so far.
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24130825
Hello, wb... here is where I'm at so far.... I don't know how close I am ... but something tells me I'm not too close.. lol... Thanks again for the help...

Jeremy
stop();
 
import flash.filters.GlowFilter;
 
import flash.filters.DropShadowFilter;
 
var curLeft:Number = book.leftpage._currentframe;
var curRight:Number = book.rightpage._currentframe;
 
var Current:Number = book.rightpage._currentframe;
trace("Went to:"+(Current));
 
 
animation._visible = false;
 
 
alphaTween = new mx.transitions.Tween(copyright, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 3, true);
alphaTween = new mx.transitions.Tween(backgroundMC, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
alphaTween = new mx.transitions.Tween(book, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 0.75, true);
alphaTween = new mx.transitions.Tween(player, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
 
var labels:Array = [];
var Opos:Array = [];
var buttonPOS:Array = [];
var offset:Number = 10;
var spreads:Array = [];
var iNum:Number = 0;
/////////////////
/// setting total frames (pages)
/////////////////
var totalFrameCT:Number = book.leftpage._totalframes;
 
iseven = ((totalFrameCT & 1) == 0)
//trace(curLeft);
		/////////////////
		/// trying to set the current
		/////////////////	
if (iseven == true){
			if (curLeft == 1){
				var opy:Number = 1; 
				//trace(opy + "iseven == true  curLeft == 1");
			}else if ((curLeft != 1) && (curLeft >= 3) && (curLeft <= (totalFrameCT - 3))) {
				var opy:Number = curLeft;
				//trace(opy + "");
			}
			
}else {
	
			if (curLeft == 1){
				var opy:Number = 1; 
				//trace(opy + "");
			}else if ((curLeft != 1) && (curLeft >= 3) && (curLeft <= (totalFrameCT - 4))) {
				var opy:Number = curLeft;
				//trace(opy + "");
			}
}
			//trace(opy);
function createButtons(ButtonType:Number, color1:Number, color2:Number, color3:Number, color4:Number, lineColor:Number, labelColor:Number, numberOfButtons:Number, posX:Number, posY:Number, labelFilterColor:Number, labelFilterAlpha:Number, labelFilterBlur:Number, labelFilterStrength:Number, applyLabelFilter:Boolean, applyBkgFilter:Boolean, nameOverRide:String) {
 
			
			
			
	for (var i:Number = opy - 1; i<ButtonType; i++) {
		
		/////////////////
		/// bumping past the cover area... 
		/////////////////
			if (nameOverRide == ""){
			var counts = i + 1; 
				if (counts <= 1){
					i++;
				}
			}
		var labelGlow:GlowFilter = new GlowFilter(labelFilterColor, labelFilterAlpha, labelFilterBlur, labelFilterBlur, labelFilterStrength, 3);
		var labelFilters:Array = [labelGlow];
		var buttonShadow:DropShadowFilter = new DropShadowFilter(1, 45, 0x000000, 1, 4, 4, 1, 3);
		var buttonFilters:Array = [buttonShadow];
		var myButton:MovieClip = this.createEmptyMovieClip("myButton"+String(i), this.getNextHighestDepth());
 
		/////////////////
		/// Setting pos 
		/////////////////
			if (nameOverRide == "Back"){
				myButton._x = posX;
			}else{
				myButton._x = offset+(posX*i);
			}
		
		
		
		myButton._y = offset+posY;
		var fillType:String = "linear";
		var colors:Array = [color1, color2, color3, color4];
		var alphas:Array = [100, 100, 100, 100];
		var ratios:Array = [0, 126, 127, 255];
		var matrix:Object = {matrixType:"box", x:0, y:0, w:40, h:30, r:90/180*Math.PI};
		myButton.createEmptyMovieClip("buttonBkg", myButton.getNextHighestDepth());
		myButton.buttonBkg.lineStyle(0, lineColor, 60, true, "none", "square", "round");
		myButton.buttonBkg.beginGradientFill(fillType, colors, alphas, ratios, matrix);
		myButton.buttonBkg.lineTo(40, 0);
		myButton.buttonBkg.lineTo(40, 30);
		myButton.buttonBkg.lineTo(0, 30);
		myButton.buttonBkg.lineTo(0, 0);
		myButton.buttonBkg.endFill();
		var myFormat:TextFormat = new TextFormat();
		myFormat.align = "center";
		myFormat.font = "Tahoma";
		myFormat.size = 13;
		myFormat.color = labelColor;
		myButton.createTextField("labelText", myButton.getNextHighestDepth(), 0, 5, myButton._width, 24);
		/////////////////
		/// lableing the buttons 
		/////////////////		
			if (nameOverRide != ""){
				myButton.labelText.text = nameOverRide;
			}else{
				myButton.labelText.text = labels[i];
			}
			
 
		myButton.labelText.embedFonts = true;
		myButton.labelText.selectable = false;
		myButton.labelText.antiAliasType = "advanced";
		myButton.labelText.setTextFormat(myFormat);
			if (applyLabelFilter) {
				myButton.labelText.filters = labelFilters;
			}
			if (applyBkgFilter) {
				myButton.filters = buttonFilters;
			}
			
		/////////////////
		/// setting buttons happenings
		/////////////////			
		var iNum = i;
		myButton.onPress = function() {
			btnWhataToDo(iNum, nameOverRide);
		};
 
 
	}
 
}
		/////////////////
		/// setting the buttons function
		/////////////////	
function btnWhataToDo (iNum:Number, nameOverRide:String)
                {
			trace (iNum)
			//var currentArray:Array = eval("messages"+buttonSeries);
			var currentButtonNumber:Number = this._name.substr(-1, 1);
			Current = book.rightpage._currentframe;
 
		/////////////////
		/// seeting destaination of the buttons 
		/////////////////					
			if (nameOverRide == "Back"){
	
				if (iseven == true){
					book.rightpage.gotoAndStop(totalFrameCT);
					book.leftpage.gotoAndStop(totalFrameCT-1);
					//trace("Went to:"+totalFrameCT+"-"+(totalFrameCT-1)+" (Back for even)");
				}else{
					book.rightpage.gotoAndStop(totalFrameCT+1);
					book.leftpage.gotoAndStop(totalFrameCT);
					//trace("Went to:"+(totalFrameCT+1)+"-"+totalFrameCT+" (Back for odd)");
				}
				
				
				
			}else if (nameOverRide == "Cover"){
				book.rightpage.gotoAndStop(2);
				book.leftpage.gotoAndStop(1);
				trace("Went to:"+0+"-"+1+" (COVER)");
			}else{
//				var onLABLES:Array = labels[i].split("-");
//				var right:Number = (onLABLES[0]-(-1));
//				var left:Number = (onLABLES[1]-(-1));
				book.rightpage.gotoAndStop(curRight + iNum);
				book.leftpage.gotoAndStop(curLeft + iNum - 1);
//				trace("Went to:"+right+"-"+left);
			}
		
			nextB = Current + 1;
			prevB = Current - 1;
			book.bl._visible = true;
			book.br._visible = true;
}
 
/////////////////
/// setting lables and spreads
/////////////////
 
for (var i:Number = 0; i<totalFrameCT; i++) {
	trace(i+1);
	
 
	labels.push(""+(i)+"-"+(i+1)+"");
 
	spreads.push(""+(i)+"-"+(i+1)+"");
	i++;
}
 
/////////////////
/// Buttons
/////////////////
 
 
//// start
createButtons(1, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 43, 80, 0xFFFFFF, .40, 4, 3, false, true, "Cover");
 
//// spread buttons
createButtons(4, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 43, 80, 0xFFFFFF, .40, 4, 3, false, true, "");
 
//// end
createButtons(1, 0xCECAF9, 0x8E77EE, 0x5339BD, 0x3216A5, 0x000000, 0xFFFFFF, 1, 182, 80, 0xFFFFFF, .40, 4, 3, false, true, "Back");
 
 
////////printing button
testPRINT.onPress = function() {
      var pj = new PrintJob();
      var success = pj.start();
      if (success)
      {
            pj.addPage(0, {xMin:0, xMax:400, yMin:0, yMax:500});
            pj.addPage("book.rightpage", {xMin:-300, xMax:300, yMin:400, yMax:800});
            pj.send();
      }
      delete pj;
};

Open in new window

0
 
LVL 39

Expert Comment

by:blue-genie
ID: 24135546
upload ur file i don't have time to go recreate everything.
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24139535
I'm tring to find the link to the file area... brb
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24139808
View all files for Question ID: 24300550
https://filedb.experts-exchange.com/incoming/ee-stuff/7600-full1.zip 

Direct link to your file
https://filedb.experts-exchange.com/incoming/ee-stuff/7600-full1.zip 


thank you again for the help...


Cheers
jeremyBass
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 24145339
ok busy downloading your stuff.
Can you describe to me in 2 sentences what it is you want to do - what i can expect when I open the file - and what it needs to do.
i'm too lazy and too confused to read through your mass of previous posts.

also if you're doing some Javascript option I can't help you there.

blu.
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 24145341
ps. in future just use the attach file option - check box under Post comment box.
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 24145468
i've opened up TEstCopyof flipbook.
you have a row of buttons on top - i'm guessing those are the ones you're refering to. but there's 2 different lots?
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24148415
It's the row that is being drawin by the api... thanks agian for the help...
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24150047
ok... I found the pagenation code...

Now all that needs to be done is to shoe horn it in... :) five steps closer... I hope....

thanks for the help...

Jeremy
var pageContent:Array = ["bob", "larry", "moe", "charlie", "john", "joe", "jesus", "mitch", "sarah", "steph", "susan", "jimmy","bob", "larry", "moe", "charlie", "john", "joe", "jesus", "mitch", "sarah", "steph", "susan", "jimmy","bob", "larry", "moe", "charlie", "john", "joe", "jesus", "mitch", "sarah", "steph", "susan", "jimmy"];
function displayPage(pageId:Number, amountPerPage:Number, target:Array):Array {
	var count:Number = pageId*amountPerPage;
	tmp = target.slice(count, count+amountPerPage);
	trace(getPageStats(tmp.length, count, count+amountPerPage>target.length ? target.length : count+amountPerPage));
	return tmp;
}
function getPageStats(len:Number, start:Number, end:Number):String {
	if (len>=1) {
		return "Displaying results "+start+" - "+end;
	} else {
		return "The specified page doesn't exist";
	}
}
trace(displayPage(0, 5, pageContent));
trace(displayPage(1, 5, pageContent));
trace(displayPage(3, 3, pageContent));
trace(displayPage(2, 5, pageContent));
trace(displayPage(3, 5, pageContent));

Open in new window

0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24150649
ok.. here is the bare bones file... it's small enough to euse the attach file here...

.txt to .fla

Thanks again for the help..

Jeremy
TESTCopy.txt
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24151232
also http://www.digitalbarn.tv/TESTCopy.fla will have my lastest version
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24152677
Ok.. got the vertical working... almost got the moving ahead function... but it's acting odd jumping a lot forward... and the way it's set now there is no back wards movement... at this point I not sure as well how to tackle the back, cover, next, prev buttons as well... I'm getting close thou...
 
here is the latest not-so greatest
http://www.digitalbarn.tv/Copy%20of%20TESTCopy.fla
 
thanks again for any and all help...
 
Cheers
jeremy
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 24156780
ok whoa  you need to ease up on the sugar dude.
you're moving to fast for me to keep up.
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24159086
Sorry I'm running out of time and so I'm trying to do it... I get close but yeah.... thanks for the help

jeremy
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24160150
I have to keep trying but Oh I'm spinning my wheels again... so far I have not found an example that looks much like what I need... I can't get it to stop jumping forward only... I'm just going rounds on it lol... here is the newest file... thou I don't know if really better than the others... any ways any help getting this finished would be great...

cheers
jeremy

http://www.digitalbarn.tv/TESTCopy3.fla
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24163300
OHHH... I'm so close... :) the buttons are working...  now I just need to insert the cover, prev, next, back btns.... and I'm done...  :)


well any help would be great... thank you...

Jeremy

latest
http://www.digitalbarn.tv/TESTCopy5.fla


I'm so excited....  :)
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 24165332
i'm getting wonkies can't get that link.
can you upload file using ee's upload file. just add a .txt - i'll have a look and see if i can work out what you're up to.
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24170414
Sure can... Thanks for the help...

Jeremy
TESTCopy5.fla.txt
0
 
LVL 39

Assisted Solution

by:blue-genie
blue-genie earned 500 total points
ID: 24178387
you say the buttons are working but when i click 12-13 i see 13 - 14 etc.
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24179086
yes... as the numbers are the frames... and the lables are right reading spread so you'd start at 0.... which you can't have a 0 frame.... so it's just +1
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24225703
Hey any luck on this... I have not had any more... I'm running short now... Tuesday is the day... so if you have an ideas on finishing this up it's be grand... just need to insert the back forward next previous....  Thanks for the help

Jeremy
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24234194
I'm not sure if your still going to help... but I'm almost done now... two little errors left to nail down...

1 the remove clip is not working
2 when "back" is clicked it's not reloading the buttons... thou I don't know if it's below but I not betting on that...

any help here would be great the deadline got move to the morning of teusday but I'm suppost to get a working model mon to dress up...

Thank you for the help...

Cheers
jeremyBass

File is commented out for you and I took the time to mark the pages better so it should be clear what I'm trying to do... thanks again...
stop();
 
import flash.filters.GlowFilter;
 
import flash.filters.DropShadowFilter;
animation._visible = false;
alphaTween = new mx.transitions.Tween(copyright, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 3, true);
alphaTween = new mx.transitions.Tween(backgroundMC, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
alphaTween = new mx.transitions.Tween(book, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 0.75, true);
alphaTween = new mx.transitions.Tween(player, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
 
 
var curLeft:Number = book.leftpage._currentframe;
var curRight:Number = book.rightpage._currentframe;
var Current:Number = book.rightpage._currentframe;
var amountPerPage:Number = 0;
var pageId:Number = 0;
var labels:Array = [];
var Opos:Array = [];
var buttonPOS:Array = [];
var offset:Number = 10;
var spreads:Array = [];
var iNum:Number = 0;
 
var starting:Number = 0;
var Enddin:Number = 5;
 
 
 
 
/////////////////
/// setting total frames (pages)
/////////////////
var totalFrameCT:Number = book.leftpage._totalframes;
 
iseven = ((totalFrameCT & 1) == 0);
 
/////////////////
/// setting lables and spreads
/////////////////
 
for (var i:Number = 0; i<totalFrameCT; i++) {
	//trace(i+1);
	labels.push(""+(i)+"-"+(i+1)+"");
	i++;
}
 
 
function createButtons(ButtonType:Number, color1:Number, color2:Number, color3:Number, color4:Number, lineColor:Number, labelColor:Number, numberOfButtons:Number, posX:Number, posY:Number, labelFilterColor:Number, labelFilterAlpha:Number, labelFilterBlur:Number, labelFilterStrength:Number, applyLabelFilter:Boolean, applyBkgFilter:Boolean, nameOverRide:String) {
 
	for (var i:Number = 0; i<ButtonType; i++) {
		/////////////////
		/// Setting pos and drawing...
		/////////////////
 
		var labelGlow:GlowFilter = new GlowFilter(labelFilterColor, labelFilterAlpha, labelFilterBlur, labelFilterBlur, labelFilterStrength, 3);
		var labelFilters:Array = [labelGlow];
		var buttonShadow:DropShadowFilter = new DropShadowFilter(1, 45, 0x000000, 1, 4, 4, 1, 3);
		var buttonFilters:Array = [buttonShadow];
 
		var myButton:MovieClip = this.createEmptyMovieClip("myButton"+String(i), this.getNextHighestDepth());
		myButton._x = offset+(posX);
		myButton._y = offset+posY;
		var fillType:String = "linear";
		var colors:Array = [color1, color2, color3, color4];
		var alphas:Array = [100, 100, 100, 100];
		var ratios:Array = [0, 126, 127, 255];
		var matrix:Object = {matrixType:"box", x:0, y:0, w:40, h:30, r:90/180*Math.PI};
		myButton.createEmptyMovieClip("buttonBkg",myButton.getNextHighestDepth());
		myButton.buttonBkg.lineStyle(0,lineColor,60,true,"none","square","round");
		myButton.buttonBkg.beginGradientFill(fillType,colors,alphas,ratios,matrix);
		myButton.buttonBkg.lineTo(40,0);
		myButton.buttonBkg.lineTo(40,30);
		myButton.buttonBkg.lineTo(0,30);
		myButton.buttonBkg.lineTo(0,0);
		myButton.buttonBkg.endFill();
		var myFormat:TextFormat = new TextFormat();
		myFormat.align = "center";
		myFormat.font = "Tahoma";
		myFormat.size = 13;
		myFormat.color = labelColor;
		myButton.createTextField("labelText",myButton.getNextHighestDepth(),0,5,myButton._width,24);
		/////////////////
		/// lableing the buttons 
		/////////////////
		if (nameOverRide != "") {
			myButton.labelText.text = nameOverRide;
		} else {
			myButton.labelText.text = "";
		}
		myButton.labelText.embedFonts = true;
		myButton.labelText.selectable = false;
		myButton.labelText.antiAliasType = "advanced";
		myButton.labelText.setTextFormat(myFormat);
		if (applyLabelFilter) {
			myButton.labelText.filters = labelFilters;
		}
		if (applyBkgFilter) {
			myButton.filters = buttonFilters;
		}
		///////////////// 
		/// setting buttons happenings
		/////////////////
		var iNum = i;
		myButton.onPress = function() {
			btnWhataToDo(iNum,nameOverRide);
			// Finds all movie clips inside gameboard_mc with the word "enemy" in their name.
 
		};
 
	}
 
}
 
 
 
/////////////////
/// setting the buttons function
/////////////////
function btnWhataToDo(iNum:Number, nameOverRide:String) {
 
 
	removeMovieClip(_level0.myButton0); 
 
 
	/////////////////
	/// setting destaination last button set 
	/////////////////
 
	Current = book.rightpage._currentframe;
	GOto = nameOverRide.split("-");
	if (nameOverRide == "Cover") {
		book.rightpage.gotoAndStop(2);
		book.leftpage.gotoAndStop(1);
	} else if (nameOverRide == "<<") {
		book.rightpage.gotoAndStop(Current-(2));
		book.leftpage.gotoAndStop(Current-(3));
	} else if (nameOverRide == ">>") {
		if (Current == totalFrameCT) {
			book.rightpage.gotoAndStop(totalFrameCT);
			book.leftpage.gotoAndStop(totalFrameCT-(1));
		} else {
			book.rightpage.gotoAndStop(Current-(-2));
			book.leftpage.gotoAndStop(Current-(-1));
		}
	} else if (nameOverRide == "Back") {
		book.rightpage.gotoAndStop(totalFrameCT);
		book.leftpage.gotoAndStop(totalFrameCT-(1));
	} else {
		book.rightpage.gotoAndStop(GOto[1]-(-1));
		book.leftpage.gotoAndStop(GOto[0]-(-1));
	}
	//book.rightpage.gotoAndStop(GOto[1]-(-1));
	//book.leftpage.gotoAndStop(GOto[0]-(-1));
	book.bl._visible = true;
	book.br._visible = true;
 
 
 
	/////////////////
	/// re-setting lables and ties for button set 
	/////////////////
 
	for (var i:Number = 0; i<labels.length; i++) {
		C = book.leftpage._currentframe;
		Lavs = labels[i].split("-");
		Lav = Lavs[0];
		if ((i*2 == Lav) && (Lav-(-1) == C)) {
			if (C<=5) {///start 
				starting = 0;
				Enddin = 5;
			} else if (C>=(totalFrameCT-(3))) {///keep the last page in the last button when it's the selected page
				Enddin = totalFrameCT;
				starting = Enddin-2;
			} else {///page movment keeping selected page center
				starting = i-2;
				Enddin = starting-(-5);
			}
 
		}
	}
	/////////////////
	/// Call new buttons 
	/////////////////
	displayPage(starting,Enddin,labels);
}
 
 
/////////////////
/// Buttons
/////////////////
 
////////printing button
testPRINT.onPress = function() {
	var pj = new PrintJob();
	var success = pj.start();
	if (success) {
		pj.addPage(0,{xMin:0, xMax:400, yMin:0, yMax:500});
		pj.addPage("book.rightpage",{xMin:-300, xMax:300, yMin:400, yMax:800});
		pj.send();
	}
	delete pj;
};
 
 
 
function displayPage(pageId:Number, amountPerPage:Number, target:Array):Array {
 
	tmp = target.slice(pageId, amountPerPage);
	trace(tmp);
	//cover btn
	createButtons(1,0xCECAF9,0x8E77EE,0x5339BD,0x3216A5,0x000000,0xFFFFFF,1,43,80,0xFFFFFF,.40,4,3,false,true,"Cover");
	//prev btn
	createButtons(1,0xCECAF9,0x8E77EE,0x5339BD,0x3216A5,0x000000,0xFFFFFF,1,86,80,0xFFFFFF,.40,4,3,false,true,"<<");
	for (var i:Number = 0; i<tmp.length; i++) {
 
		//page btn
		createButtons(1,0xCECAF9,0x8E77EE,0x5339BD,0x3216A5,0x000000,0xFFFFFF,1,43*i-(-129),80,0xFFFFFF,.40,4,3,false,true,""+tmp[i]+"");
 
	}
	//next btn
	createButtons(1,0xCECAF9,0x8E77EE,0x5339BD,0x3216A5,0x000000,0xFFFFFF,1,344,80,0xFFFFFF,.40,4,3,false,true,">>");
	//back btn
	createButtons(1,0xCECAF9,0x8E77EE,0x5339BD,0x3216A5,0x000000,0xFFFFFF,1,387,80,0xFFFFFF,.40,4,3,false,true,"Back");
	return tmp;
}
 
displayPage(0,5,labels);

Open in new window

TESTCopy6-CS3.fla.txt
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24234236
ok... just the deleting of the buttons before recreation to go....
stop();
 
import flash.filters.GlowFilter;
 
import flash.filters.DropShadowFilter;
animation._visible = false;
alphaTween = new mx.transitions.Tween(copyright, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 3, true);
alphaTween = new mx.transitions.Tween(backgroundMC, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
alphaTween = new mx.transitions.Tween(book, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 0.75, true);
alphaTween = new mx.transitions.Tween(player, "_alpha", mx.transitions.easing.Regular.easeInOut, 0, 100, 1, true);
 
 
var curLeft:Number = book.leftpage._currentframe;
var curRight:Number = book.rightpage._currentframe;
var Current:Number = book.rightpage._currentframe;
var amountPerPage:Number = 0;
var pageId:Number = 0;
var labels:Array = [];
var Opos:Array = [];
var buttonPOS:Array = [];
var offset:Number = 10;
var spreads:Array = [];
var iNum:Number = 0;
 
var starting:Number = 0;
var Enddin:Number = 5;
 
 
 
 
/////////////////
/// setting total frames (pages)
/////////////////
var totalFrameCT:Number = book.leftpage._totalframes;
 
iseven = ((totalFrameCT & 1) == 0);
 
/////////////////
/// setting lables and spreads
/////////////////
 
for (var i:Number = 0; i<totalFrameCT; i++) {
	//trace(i+1);
	labels.push(""+(i)+"-"+(i+1)+"");
	i++;
}
 
 
function createButtons(ButtonType:Number, color1:Number, color2:Number, color3:Number, color4:Number, lineColor:Number, labelColor:Number, numberOfButtons:Number, posX:Number, posY:Number, labelFilterColor:Number, labelFilterAlpha:Number, labelFilterBlur:Number, labelFilterStrength:Number, applyLabelFilter:Boolean, applyBkgFilter:Boolean, nameOverRide:String) {
 
	for (var i:Number = 0; i<ButtonType; i++) {
		/////////////////
		/// Setting pos and drawing...
		/////////////////
 
		var labelGlow:GlowFilter = new GlowFilter(labelFilterColor, labelFilterAlpha, labelFilterBlur, labelFilterBlur, labelFilterStrength, 3);
		var labelFilters:Array = [labelGlow];
		var buttonShadow:DropShadowFilter = new DropShadowFilter(1, 45, 0x000000, 1, 4, 4, 1, 3);
		var buttonFilters:Array = [buttonShadow];
 
		var myButton:MovieClip = this.createEmptyMovieClip("myButton"+String(i), this.getNextHighestDepth());
		myButton._x = offset+(posX);
		myButton._y = offset+posY;
		var fillType:String = "linear";
		var colors:Array = [color1, color2, color3, color4];
		var alphas:Array = [100, 100, 100, 100];
		var ratios:Array = [0, 126, 127, 255];
		var matrix:Object = {matrixType:"box", x:0, y:0, w:40, h:30, r:90/180*Math.PI};
		myButton.createEmptyMovieClip("buttonBkg",myButton.getNextHighestDepth());
		myButton.buttonBkg.lineStyle(0,lineColor,60,true,"none","square","round");
		myButton.buttonBkg.beginGradientFill(fillType,colors,alphas,ratios,matrix);
		myButton.buttonBkg.lineTo(40,0);
		myButton.buttonBkg.lineTo(40,30);
		myButton.buttonBkg.lineTo(0,30);
		myButton.buttonBkg.lineTo(0,0);
		myButton.buttonBkg.endFill();
		var myFormat:TextFormat = new TextFormat();
		myFormat.align = "center";
		myFormat.font = "Tahoma";
		myFormat.size = 13;
		myFormat.color = labelColor;
		myButton.createTextField("labelText",myButton.getNextHighestDepth(),0,5,myButton._width,24);
		/////////////////
		/// lableing the buttons 
		/////////////////
		if (nameOverRide != "") {
			myButton.labelText.text = nameOverRide;
		} else {
			myButton.labelText.text = "";
		}
		myButton.labelText.embedFonts = true;
		myButton.labelText.selectable = false;
		myButton.labelText.antiAliasType = "advanced";
		myButton.labelText.setTextFormat(myFormat);
		if (applyLabelFilter) {
			myButton.labelText.filters = labelFilters;
		}
		if (applyBkgFilter) {
			myButton.filters = buttonFilters;
		}
		///////////////// 
		/// setting buttons happenings
		/////////////////
		var iNum = i;
		myButton.onPress = function() {
			btnWhataToDo(iNum,nameOverRide);
			// Finds all movie clips inside gameboard_mc with the word "enemy" in their name.
 
		};
 
	}
 
}
 
 
 
/////////////////
/// setting the buttons function
/////////////////
function btnWhataToDo(iNum:Number, nameOverRide:String) {
 
 
 
 
 
	/////////////////
	/// setting destaination last button set 
	/////////////////
 
	Current = book.rightpage._currentframe;
	GOto = nameOverRide.split("-");
	if (nameOverRide == "Cover") {
		book.rightpage.gotoAndStop(2);
		book.leftpage.gotoAndStop(1);
	} else if (nameOverRide == "<<") {
		book.rightpage.gotoAndStop(Current-(2));
		book.leftpage.gotoAndStop(Current-(3));
	} else if (nameOverRide == ">>") {
		if (Current == totalFrameCT) {
			book.rightpage.gotoAndStop(totalFrameCT);
			book.leftpage.gotoAndStop(totalFrameCT-(1));
		} else {
			book.rightpage.gotoAndStop(Current-(-2));
			book.leftpage.gotoAndStop(Current-(-1));
		}
	} else if (nameOverRide == "Back") {
		book.rightpage.gotoAndStop(totalFrameCT);
		book.leftpage.gotoAndStop(totalFrameCT-(1));
	} else {
		book.rightpage.gotoAndStop(GOto[1]-(-1));
		book.leftpage.gotoAndStop(GOto[0]-(-1));
	}
	//book.rightpage.gotoAndStop(GOto[1]-(-1));
	//book.leftpage.gotoAndStop(GOto[0]-(-1));
	book.bl._visible = true;
	book.br._visible = true;
 
	removeMovieClip(_level0.myButton0); 
 
	/////////////////
	/// re-setting lables and ties for button set 
	/////////////////
 
	for (var i:Number = 0; i<labels.length; i++) {
		C = book.leftpage._currentframe;
		Lavs = labels[i].split("-");
		Lav = Lavs[0];
		if ((i*2 == Lav) && (Lav-(-1) == C)) {
			if (C<=5) {///start 
				starting = 0;
				Enddin = 5;
			} else if (C>=(totalFrameCT-(3))) {///keep the last page in the last button when it's the selected page
				starting = i-4;
				Enddin = starting-(-5);
			} else {///page movment keeping selected page center
				starting = i-2;
				Enddin = starting-(-5);
			}
 
		}
	}
	/////////////////
	/// Call new buttons 
	/////////////////
	displayPage(starting,Enddin,labels);
}
 
 
/////////////////
/// Buttons
/////////////////
 
////////printing button
testPRINT.onPress = function() {
	var pj = new PrintJob();
	var success = pj.start();
	if (success) {
		pj.addPage(0,{xMin:0, xMax:400, yMin:0, yMax:500});
		pj.addPage("book.rightpage",{xMin:-300, xMax:300, yMin:400, yMax:800});
		pj.send();
	}
	delete pj;
};
 
 
 
function displayPage(pageId:Number, amountPerPage:Number, target:Array):Array {
 
	tmp = target.slice(pageId, amountPerPage);
	trace(tmp);
	//cover btn
	createButtons(1,0xCECAF9,0x8E77EE,0x5339BD,0x3216A5,0x000000,0xFFFFFF,1,43,80,0xFFFFFF,.40,4,3,false,true,"Cover");
	//prev btn
	createButtons(1,0xCECAF9,0x8E77EE,0x5339BD,0x3216A5,0x000000,0xFFFFFF,1,86,80,0xFFFFFF,.40,4,3,false,true,"<<");
	for (var i:Number = 0; i<tmp.length; i++) {
 
		//page btn
		createButtons(1,0xCECAF9,0x8E77EE,0x5339BD,0x3216A5,0x000000,0xFFFFFF,1,43*i-(-129),80,0xFFFFFF,.40,4,3,false,true,""+tmp[i]+"");
 
	}
	//next btn
	createButtons(1,0xCECAF9,0x8E77EE,0x5339BD,0x3216A5,0x000000,0xFFFFFF,1,344,80,0xFFFFFF,.40,4,3,false,true,">>");
	//back btn
	createButtons(1,0xCECAF9,0x8E77EE,0x5339BD,0x3216A5,0x000000,0xFFFFFF,1,387,80,0xFFFFFF,.40,4,3,false,true,"Back");
	return tmp;
}
 
displayPage(0,5,labels);

Open in new window

0
 
LVL 4

Accepted Solution

by:
jeremyBass26 earned 0 total points
ID: 24234293
the last part was...



for (var i in _root)
{
if (typeof (this[i]) == "movieclip")
{
      if (this[i]._name == "myButton0"){
            removeMovieClip(this[i]._name);
      }
}
}


so it's DONE... :D
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 24248260
hi you can keep the points.
i did help out with your original problem but then I got lost in terms of what you were trying to do when you said things were working in xyz but when I downloaded your file they weren't.
sorry i just couldn't keep up with your bits and pieces and you were going along quite nicely and I figured if I left you to plod along you'd get there eventually as with each post you seemed to be progressing.
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24250888
It's ok.. Like I said in the first comment it could have been interpreted that all I was looking for was the 1-2,3-4 type grouping alone... which was not the case but I should have been more clear...

You get the points for coming back... And being the only brave enough to step up...

Cheers
Jeremy
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 24262996
Hey you didn't think I was trying to be insulting did you?  just had to ask... I am greatful for the help the times before and for the try here...

Cheers
Jeremy
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question