coolbox
September 28th, 2007, 12:18 PM
Ok so i am using one of those E-Magazine/Flipping Book Flash components to build an application. I am very very new to Actionscript so i would appreciate if someone could hold my hand through this please. I am working primarily from tutorials i can find on the net, it is slow progress.
I am trying out some solutions for zooming into the magazine component. The simplest one so far has been a simple resizeing of the component using the accompanied API. One button makes the component bigger the other button makes the component smaller. It works well but its not very elaborate.
I found a tutorial about Dynamic Resizeing which is pretty cool. I have managed to apply the code to my component and have created two buttons again, one to make the component reSize and one to make it shrink again.
However on reSize of the component i am now no longer able to turn the pages of the magazine or utilise the component in any way or form, it just 'appears' as a single image on the stage. Can anyone help please?
The code i am using is:
MovieClip.prototype.resizeMe = function(w, h){
var speed = 4;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if( Math.abs(this._width-w)<1){
this._width = w;
this._height = h;
stage.loadMovie(myBook);
delete this.onEnterFrame;
}
}
};
function btnClicked1() {
myBook.resizeMe(900, 2400);
}
function btnClicked2() {
myBook.resizeMe(600, 1640);
}
btn1.addEventListener("click", btnClicked1);
btn2.addEventListener("click", btnClicked2);
Thanks in advance for your support.
I am trying out some solutions for zooming into the magazine component. The simplest one so far has been a simple resizeing of the component using the accompanied API. One button makes the component bigger the other button makes the component smaller. It works well but its not very elaborate.
I found a tutorial about Dynamic Resizeing which is pretty cool. I have managed to apply the code to my component and have created two buttons again, one to make the component reSize and one to make it shrink again.
However on reSize of the component i am now no longer able to turn the pages of the magazine or utilise the component in any way or form, it just 'appears' as a single image on the stage. Can anyone help please?
The code i am using is:
MovieClip.prototype.resizeMe = function(w, h){
var speed = 4;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if( Math.abs(this._width-w)<1){
this._width = w;
this._height = h;
stage.loadMovie(myBook);
delete this.onEnterFrame;
}
}
};
function btnClicked1() {
myBook.resizeMe(900, 2400);
}
function btnClicked2() {
myBook.resizeMe(600, 1640);
}
btn1.addEventListener("click", btnClicked1);
btn2.addEventListener("click", btnClicked2);
Thanks in advance for your support.