Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








A Long Piece Of Code With A Problem..


ok.. here's the situation: m tryin to make a man jump with this code. the man should keep jumping as long as i keep the spacebar pressed. but the problem is, for the first jump, the MC skips frame no. 2 to 6 and hence the jump is shortened.
the jmp MC contains animation for the actions while jumping. the actual up and down movement is generated in the code below. this code is written in the frame of the root movie. the root movie has several layers but is only one frame long.

below the code i have pasted the trace results. please please help me out. i'm stumped.

myListener.onKeyDown = function ()
{

if(Key.isDown(Key.SPACE))
{
trace("space "+jumping); //jumping is an int variable. indicates whether the man is already in air jumping(1) or not(0).
if(jumping==0)
{
trace("jumping is 0");
_root.sm._visible = false; //a MC showing standing man. irrelevant.
_root.runner._visible = false; //a MC showing running man. irrelevant.
_root.attachMovie("pjump","jmp",200);
jmp._x = manposx;
jmp._y = _root.surface._y - _root.surface._height/2 - _root.manheight - 20;
jumping = 1;
jmp.play();
trace("1.frame: "+jmp._currentframe);
}
trace("2.frame: "+jmp._currentframe);
if(jmp._currentframe>2 && jmp._currentframe<8)
{
trace(jmp._y + " frame " + jmp._currentframe);
jmp._y-=20;
trace("after "+jmp._y);
}
trace("3.frame: "+jmp._currentframe);
if(jmp._currentframe>=8)
{
jmp._y+=15;
}

trace("4.frame: "+jmp._currentframe+ " stpscl "+stopscroll);
border = jmp._y + jmp._height/2

if( border > ( surface._y - (surface._height/2) + 40) )
{
jumping = 0;
}
trace("5.frame: "+jmp._currentframe);
if(_root.opponent._x - jmp._x <700)// irrelevant
_root.attack = 1;
trace("6.frame: "+jmp._currentframe);
}
}


surface is the ground on which he stands. stuff marked irrelevant is of course, irrelevant to this problem..
the jmp movie is 10 frames long.
here's the outcome:

space 0 //ROUND ONE
jumping is 0
1.frame: 1
2.frame: 1
3.frame: 1
4.frame: 1
5.frame: 1
6.frame: 1
space 1
2.frame: 6 //THERE YOU GO..
265.4 frame 6
after 245.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 7
245.4 frame 7
after 225.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
225.4 frame 7
after 205.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
205.4 frame 7
after 185.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
379.05 surface 376.9
5.frame: 10
6.frame: 10
space 0
jumping is 0
1.frame: 1 //ROUND TWO
2.frame: 1 //EVERYTHING IS SMOOTH FROM HEREON..
3.frame: 1
4.frame: 1
5.frame: 1
6.frame: 1
space 1
2.frame: 2
3.frame: 2
4.frame: 2
5.frame: 2
6.frame: 2
space 1
2.frame: 2
3.frame: 2
4.frame: 2
5.frame: 2
6.frame: 2
space 1
2.frame: 3
265.4 frame 3
after 245.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 3
245.4 frame 3
after 225.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 3
225.4 frame 3
after 205.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 4
205.4 frame 4
after 185.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 4
185.4 frame 4
after 165.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 4
165.4 frame 4
after 145.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 5
145.4 frame 5
after 125.4
3.frame: 5
4.frame: 5
5.frame: 5
6.frame: 5
space 1
2.frame: 5
125.4 frame 5
after 105.4
3.frame: 5
4.frame: 5
5.frame: 5
6.frame: 5
space 1
2.frame: 6
105.4 frame 6
after 85.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 6
85.4 frame 6
after 65.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 6
65.4 frame 6
after 45.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 7
45.4 frame 7
after 25.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
25.4 frame 7
after 5.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
5.4 frame 7
after -14.6
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
379.925 surface 376.9
5.frame: 10
6.frame: 10
space 0
jumping is 0

and so on.. please help me..




ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 11-12-2006, 05:47 PM


View Complete Forum Thread with Replies

Sponsored Links:

A Long Piece Of Code With A Problem.. Help PLEASE
ok.. here's the situation: m tryin to make a man jump with this code. the man should keep jumping as long as i keep the spacebar pressed. but the problem is, for the first jump, the MC skips frame no. 2 to 6 and hence the jump is shortened.
the jmp MC contains animation for the actions while jumping. the actual up and down movement is generated in the code below. this code is written in the frame of the root movie. the root movie has several layers but is only one frame long.

below the code i have pasted the trace results. please please help me out. i'm stumped.

myListener.onKeyDown = function ()
{

if(Key.isDown(Key.SPACE))
{
trace("space "+jumping); //jumping is an int variable. indicates whether the man is already in air jumping(1) or not(0).
if(jumping==0)
{
trace("jumping is 0");
_root.sm._visible = false; //a MC showing standing man. irrelevant.
_root.runner._visible = false; //a MC showing running man. irrelevant.
_root.attachMovie("pjump","jmp",200);
jmp._x = manposx;
jmp._y = _root.surface._y - _root.surface._height/2 - _root.manheight - 20;
jumping = 1;
jmp.play();
trace("1.frame: "+jmp._currentframe);
}
trace("2.frame: "+jmp._currentframe);
if(jmp._currentframe>2 && jmp._currentframe<8)
{
trace(jmp._y + " frame " + jmp._currentframe);
jmp._y-=20;
trace("after "+jmp._y);
}
trace("3.frame: "+jmp._currentframe);
if(jmp._currentframe>=8)
{
jmp._y+=15;
}

trace("4.frame: "+jmp._currentframe+ " stpscl "+stopscroll);
border = jmp._y + jmp._height/2

if( border > ( surface._y - (surface._height/2) + 40) )
{
jumping = 0;
}
trace("5.frame: "+jmp._currentframe);
if(_root.opponent._x - jmp._x <700)// irrelevant
_root.attack = 1;
trace("6.frame: "+jmp._currentframe);
}
}


surface is the ground on which he stands. stuff marked irrelevant is of course, irrelevant to this problem..
the jmp movie is 10 frames long.
here's the outcome:

space 0 //ROUND ONE
jumping is 0
1.frame: 1
2.frame: 1
3.frame: 1
4.frame: 1
5.frame: 1
6.frame: 1
space 1
2.frame: 6 //THERE YOU GO..
265.4 frame 6
after 245.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 7
245.4 frame 7
after 225.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
225.4 frame 7
after 205.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
205.4 frame 7
after 185.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
379.05 surface 376.9
5.frame: 10
6.frame: 10
space 0
jumping is 0
1.frame: 1 //ROUND TWO
2.frame: 1 //EVERYTHING IS SMOOTH FROM HEREON..
3.frame: 1
4.frame: 1
5.frame: 1
6.frame: 1
space 1
2.frame: 2
3.frame: 2
4.frame: 2
5.frame: 2
6.frame: 2
space 1
2.frame: 2
3.frame: 2
4.frame: 2
5.frame: 2
6.frame: 2
space 1
2.frame: 3
265.4 frame 3
after 245.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 3
245.4 frame 3
after 225.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 3
225.4 frame 3
after 205.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 4
205.4 frame 4
after 185.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 4
185.4 frame 4
after 165.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 4
165.4 frame 4
after 145.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 5
145.4 frame 5
after 125.4
3.frame: 5
4.frame: 5
5.frame: 5
6.frame: 5
space 1
2.frame: 5
125.4 frame 5
after 105.4
3.frame: 5
4.frame: 5
5.frame: 5
6.frame: 5
space 1
2.frame: 6
105.4 frame 6
after 85.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 6
85.4 frame 6
after 65.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 6
65.4 frame 6
after 45.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 7
45.4 frame 7
after 25.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
25.4 frame 7
after 5.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
5.4 frame 7
after -14.6
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
379.925 surface 376.9
5.frame: 10
6.frame: 10
space 0
jumping is 0

and so on.. please help me..

View Replies !    View Related
A Long Piece Of Code With A Problem.. Help PLEASE
ok.. here's the situation: m tryin to make a man jump with this code. the man should keep jumping as long as i keep the spacebar pressed. but the problem is, for the first jump, the MC skips frame no. 2 to 6 and hence the jump is shortened.
the jmp MC contains animation for the actions while jumping. the actual up and down movement is generated in the code below. this code is written in the frame of the root movie. the root movie has several layers but is only one frame long.

below the code i have pasted the trace results. please please help me out. i'm stumped.

myListener.onKeyDown = function ()
{

if(Key.isDown(Key.SPACE))
{
trace("space "+jumping); //jumping is an int variable. indicates whether the man is already in air jumping(1) or not(0).
if(jumping==0)
{
trace("jumping is 0");
_root.sm._visible = false; //a MC showing standing man. irrelevant.
_root.runner._visible = false; //a MC showing running man. irrelevant.
_root.attachMovie("pjump","jmp",200);
jmp._x = manposx;
jmp._y = _root.surface._y - _root.surface._height/2 - _root.manheight - 20;
jumping = 1;
jmp.play();
trace("1.frame: "+jmp._currentframe);
}
trace("2.frame: "+jmp._currentframe);
if(jmp._currentframe>2 && jmp._currentframe<8)
{
trace(jmp._y + " frame " + jmp._currentframe);
jmp._y-=20;
trace("after "+jmp._y);
}
trace("3.frame: "+jmp._currentframe);
if(jmp._currentframe>=8)
{
jmp._y+=15;
}

trace("4.frame: "+jmp._currentframe+ " stpscl "+stopscroll);
border = jmp._y + jmp._height/2

if( border > ( surface._y - (surface._height/2) + 40) )
{
jumping = 0;
}
trace("5.frame: "+jmp._currentframe);
if(_root.opponent._x - jmp._x <700)// irrelevant
_root.attack = 1;
trace("6.frame: "+jmp._currentframe);
}
}


surface is the ground on which he stands. stuff marked irrelevant is of course, irrelevant to this problem..
the jmp movie is 10 frames long.
here's the outcome:

space 0 //ROUND ONE
jumping is 0
1.frame: 1
2.frame: 1
3.frame: 1
4.frame: 1
5.frame: 1
6.frame: 1
space 1
2.frame: 6 //THERE YOU GO..
265.4 frame 6
after 245.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 7
245.4 frame 7
after 225.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
225.4 frame 7
after 205.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
205.4 frame 7
after 185.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
379.05 surface 376.9
5.frame: 10
6.frame: 10
space 0
jumping is 0
1.frame: 1 //ROUND TWO
2.frame: 1 //EVERYTHING IS SMOOTH FROM HEREON..
3.frame: 1
4.frame: 1
5.frame: 1
6.frame: 1
space 1
2.frame: 2
3.frame: 2
4.frame: 2
5.frame: 2
6.frame: 2
space 1
2.frame: 2
3.frame: 2
4.frame: 2
5.frame: 2
6.frame: 2
space 1
2.frame: 3
265.4 frame 3
after 245.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 3
245.4 frame 3
after 225.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 3
225.4 frame 3
after 205.4
3.frame: 3
4.frame: 3
5.frame: 3
6.frame: 3
space 1
2.frame: 4
205.4 frame 4
after 185.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 4
185.4 frame 4
after 165.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 4
165.4 frame 4
after 145.4
3.frame: 4
4.frame: 4
5.frame: 4
6.frame: 4
space 1
2.frame: 5
145.4 frame 5
after 125.4
3.frame: 5
4.frame: 5
5.frame: 5
6.frame: 5
space 1
2.frame: 5
125.4 frame 5
after 105.4
3.frame: 5
4.frame: 5
5.frame: 5
6.frame: 5
space 1
2.frame: 6
105.4 frame 6
after 85.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 6
85.4 frame 6
after 65.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 6
65.4 frame 6
after 45.4
3.frame: 6
4.frame: 6
5.frame: 6
6.frame: 6
space 1
2.frame: 7
45.4 frame 7
after 25.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
25.4 frame 7
after 5.4
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 7
5.4 frame 7
after -14.6
3.frame: 7
4.frame: 7
5.frame: 7
6.frame: 7
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 8
3.frame: 8
4.frame: 8
5.frame: 8
6.frame: 8
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 9
3.frame: 9
4.frame: 9
5.frame: 9
6.frame: 9
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
5.frame: 10
6.frame: 10
space 1
2.frame: 10
3.frame: 10
4.frame: 10
379.925 surface 376.9
5.frame: 10
6.frame: 10
space 0
jumping is 0

and so on.. please help me..

View Replies !    View Related
Help How To Display A Very Long Piece Of Texte ?
I have something to do and I don't have any idea of how to do it.

I have to display a very long list of questions / answers, the list is about 6 times the height of the screen.

Have you any ideas of how to display this (split in several parts, use of scrolling...)

Thanks for any help,

View Replies !    View Related
Help With A Piece Of Code
please dont think me an idiot here but I am baffled by this little piece of code... I have even referenced a couple of my actionscript books and they have it written just like I do.... here it is, can anyone tell me why it doesnt work

_level2.loadMovie("wwimenu1.swf");

or

_level2.loadMovieNum("wwimenu1.swf");

I will say that I am very tired and perhaps missing something obvious but I do not see it for the life of me

I have targeted many a movie clip and referenced the _root in this manner many times today...

_root.loadMovie("wwwimenu1.swf") works but of course that doesnt help...

Thanks for your help in advance... appreciate any feedback or any "hey you idiot that &*%$ doesnt go there..."'s

View Replies !    View Related
Favorite Piece Of Code
I'm not sure if this is the right forum, but I thought it'd be cool to post your favorite piece of code. Nothing too big. I'll start it out:


Code:
MovieClip.prototype.forward = function() {
this.onEnterFrame = function() {
//set variable to current frame
//check to see if movie has reached last frame
if (this._currentframe=="end") {
//reset variable
this.lastFrame = undefined;
delete this.onEnterFrame;
} else {
//move to next frame
this.nextFrame();
}
};
};
//play movie backwards
MovieClip.prototype.backward = function() {
this.onEnterFrame = function() {
//check to see if movie at beginning frame
if (this._currentframe==1) {
delete this.onEnterFrame;
} else {
//move to previous frame
this.prevFrame();
}
};
};


You can use this to play mcs forward and backward using forward() and backward() as commands. Forward will stop when the frame reaches a frame labeled "end". You could add a variable to the methods, indicating which frame to stop on.

View Replies !    View Related
What Is Wrong With This Piece Of... Code?
Ok...
For those that have some experience with C++ i am trying to create a structure and then create a bidimensional array using that same structure.

Code:
struct det()
{
name="";
surname="";
country="";
age="";
add="";
sex="";
}_global.det = new Array[50,50];

_global.det[1,1].name="John";
trace(_global.det[1,1].name);
But doesnt work!
How can i do that with AS???
Thanks...
Cheers.
Le.

View Replies !    View Related
[F8] Am I Missing A Piece Of This Code?
Here is my current script: (This is the area of my script where I think I am missing something.)

//these functions decide who won

function youWin() {
if (myScore>=10) {
this.gotoAndPlay ("winningend");
}
}
function youLose() {
if (dangerScore>=10) {
this.gotoAndPlay("loosingend");
}
}
stop();



On the winning end screen and loosing end this is my code:

//this stops it from advancing
stop();
//This is the music to end the game
music_loop.stop();
music_loop.attachSound("endingMusic.wav");
music_loop.start(0,999);



If anyone can fill me in what I'm missing it would be greatly appreciated. Or if I need to look at a different area of my code or if I am doing it assbackward all together. ThanksaBunxh!!!

View Replies !    View Related
[F8] Running A Piece Of Code After MC
Hi, What im trying to do is: Run a piece of code when the playhead reaches the last frame on a seperate movie clip. I understand that i need something that will recognise when the movieclip is on its last frame and call the function i have, but no idea on how to do it.

The code i'm trying to run is: (This is on its own layer on the stage)

this.onEnterFrame = function() {
if (this.black_mc._x<175) {
this.black_mc._x -= 5;
}
};


Thanks! xx

View Replies !    View Related
What Is Wrong With This Piece Of.... Code.
Hi there!
I am having some problems with my code no idea if it is logical or what is it. For some reason, when i move or access the buttons on a vertical motion, gives me the wrong coordinates. While with horizontal movement its ok.
I cracked my head and i could find why.
Trying to do a BattleShip game.

HELP!

The file is attached. Download it, and c what i am talking about.
Cheers!
Leo.

View Replies !    View Related
Small Piece Of Code Help Please
Hi, I have to following snippet:

_root.MyMovie0._y -= 10;
_root.MyMovie1._y -= 10;
_root.MyMovie2._y -= 10;
_root.MyMovie3._y -= 10;
_root.MyMovie._y -= 10;

I want to replace the "MyMovie"-values with an array. I did the following but it doesnt work.

for (i=0; i<Descriptions_length; i++) {
_root.this["MyMovie" + i]._y -= 10;
)
Anyone an idea?

cheers
Patrick

View Replies !    View Related
Whats Wrong With This Piece Of Code?
onClipEvent (load) {
for (i=0; i<10; i++) {
this.duplicateMovieClip("ball"+i,i);
_root["ball"+i]._x=i*25;
_root["ball"+i]._y=10;
}
}


When I'm trying to execute this scrip I get this alert from Flash. "A script in this movie is causing Flash Player to run slowly..." The script is attached to a MC called "ball" and there is no other script in this movie...What's wrong? I just can't figure it out...

View Replies !    View Related
Can You Explain This Simple Piece Of Code
I understand all expect on line
All comments are mine so you can check this too


onClipEvent(data){
//for every element in array _root.new
for(value in _root.dummy){
//if value is diffrent than start
if(value ne "start"){
//add element "value" to array myArray
_root.myName.push(value)
// I AM LOST
_root.myValue.push(eval(value))
}
//if value is equal start
if(value eq "start"){
//give _root.start value of element start
_root.start = eval(value);
}
}
_root.total = _root.myName.length;
}

View Replies !    View Related
Whats The AS 3.0 Equivalent Of The Following Piece Of Code?
Hi all ,
i would like to know how i could the following piece of code in AS 3.0?

Code:
this.onEnterFrame = function(){
if(variableName != undefined){
gotoAndStop(variableName);
delete onEnterFrame;
}
}


The above is in AS 2.0

Basically I want movie to go to a certain frame depending on the value of the variable and when the variable is assigned a value.

Thanks

Q

View Replies !    View Related
Translate Small Piece Of Code From C++
this is a piece of c++ code:

PHP Code:




// Apply Lenard-Jones potential force to Craft2
void DoAttractCraft2(void)
{
Vector r = Craft2.vPosition - Craft1.vPosition;
Vector u = r;
u.Normalize();
double U, A, B, n, m, d;
A = 2000;
B = 4000;
n = 2;
m = 3;
d = r.Magnitude()/Craft2.fLength;
U = -A/pow(d, n) + B/pow(d, m);
Craft2.Fa = VRotate2D( -Craft2.fOrientation, U * u);
Craft2.Pa.x = 0;
Craft2.Pa.y = Craft2.fLength / 2;
Target = Craft1.vPosition;
}







how do you translate it into as3?

View Replies !    View Related
Why This Simple Piece Of Code Isn't Working
This code should find the x,y position of the number 2 inside a multidimensional array. Now for some reason sprite.px and sprite.py always return as undefined in the trace below. I'm not entirely sure why this is happening. Any ideas?


ActionScript Code:
for (var x = 0; x<map[x].length; x++) {
        for (var y = 0; y<map.length; y++) {
            if (map[y][x] == 2) {
                trace(x);
                trace(y);
                sprite.px = x;
                sprite.py = y;
                trace(sprite.px);
                trace(sprite.py);
            }
        }
    }

View Replies !    View Related
What's Wrong With This Piece Of Code (positioning)
I'm trying to position a movieclip on the center of the stage

Code:
MC.x = (stage.width/2)-(MC.width/2);
MC.y = (stage.height/2)-(MC.height/2);
When I do this, it doesn't even get close to the center of the stage :-(

View Replies !    View Related
Flash 5-only Piece Of Code - For Player Testing
Anyone know a good piece of code that only the Flash 5 player'd recognize?

Thanks for any help
Cheers

View Replies !    View Related
Experts : Flash 5 Hates This Piece Of Code :( Why ?
hello everybody,
i dont know what is going on , i have created this piece of code with mx (it was working all ok) , but when i tried opening with flash 5 after saving as flash 5 i have faced many problems

1- there is an error in this piece of code , i cant find it this error is very irritating to flash 5 as it makes it un responding sometimes
when i check syntax i find this in the output

Line 22: 'else' encountered without matching 'if'
else if ((_root["answer1"] != _root["correctAnswer1"] && _root["answer1"] != _root["correctAnswer_alt1"]) && (_root["answer2"] != _root["correctAnswer2"] && _root["answer2"] != _root["correctAnswer_alt2"]) && (_root["answer3"] != _root["correctAnswer3"] && _root["answer3"] != _root["correctAnswer_alt3"]) && (_root["answer4"] != _root["correctAnswer4"] && _root["answer4"] != _root["correctAnswer_alt4"]) && (_root["answer5"] != _root["correctAnswer5"] && _root["answer5"] != _root["correctAnswer_alt5"])){



here u r the code , plz try to help

Code:

on (release, releaseOutside) {
for (k=1; k<maxanswers+1; k++) {
if (_root["answer"+k] == _root["correctAnswer"+k] || _root["answer"+k] == _root["correctAnswer_alt"+k]) {
//main if
//if: main if .if 2
if ((_root["answer1"] == _root["correctAnswer1"] || _root["answer1"] == _root["correctAnswer_alt1"]) && (_root["answer2"] == _root["correctAnswer2"] || _root["answer2"] == _root["correctAnswer_alt2"]) && (_root["answer3"] == _root["correctAnswer3"] || _root["answer3"] == _root["correctAnswer_alt3"]) && (_root["answer4"] == _root["correctAnswer4"] || _root["answer4"] == _root["correctAnswer_alt4"]) && (_root["answer5"] == _root["correctAnswer5"] || _root["answer5"] == _root["correctAnswer_alt5"])) {
gotoAndPlay("correctframe");
score++;
//else: main if .if 2 - else
} else {
score++;
gotoAndPlay("case3frame");
}
//else: main if _ else
} else {
//if: main if _ else .if
if (_root["answer1"]=="" && _root["answer2"]=="" && _root["answer3"]=="" && _root["answer4"]=="" && _root["answer5"]=="" )
{ _root.alertmc.gotoAndStop(2);
_root.alertmc._visible=true;
}
//if: main if _ else .if.else if
else if ((_root["answer1"] != _root["correctAnswer1"] && _root["answer1"] != _root["correctAnswer_alt1"]) && (_root["answer2"] != _root["correctAnswer2"] && _root["answer2"] != _root["correctAnswer_alt2"]) && (_root["answer3"] != _root["correctAnswer3"] && _root["answer3"] != _root["correctAnswer_alt3"]) && (_root["answer4"] != _root["correctAnswer4"] && _root["answer4"] != _root["correctAnswer_alt4"]) && (_root["answer5"] != _root["correctAnswer5"] && _root["answer5"] != _root["correctAnswer_alt5"])){
gotoAndPlay("wrongframe");
}

}
//main if end
}
// for end
}
// on release end


THANKS

View Replies !    View Related
Grab Piece Of Code From An External File?
Hello,

How do you put a small part of your actionscript, in an external file (so it can easily be changed).

For example, I want this small piece of code (in an if/than statement) to put in an external file:

clr = "0xCCCCCC"

Is this possible?

View Replies !    View Related
Flash 8 Error In Tiny Piece Of Code
Here is the error from my flash 8 output screen


**Error** Scene=entry, layer=texts, frame=1:Line 2: ')' expected
if (user add pass eq "" add "") {

**Error** Scene=entry, layer=texts, frame=1:Line 3: Statement must appear within on handler
gotoAndStop("denied", 1);

**Error** Scene=entry, layer=texts, frame=1:Line 4: Unexpected '}' encountered
} else {

Total ActionScript Errors: 3 Reported Errors: 3



Here is the actual piece of code:


on (release, keyPress "<Enter>") {
if (user add pass eq "" add "") {
gotoAndStop("denied", 1);
} else {
gotoAndPlay(2);
}
}


I am an artist not a programmer. I'm not dumb but I don't have the wonderful talent that many of you have. I make websites look good but I need your help to make them work at all. This little piece of code comes from a login script
< http://www.actionscripts.org/showMovie.php?id=576 > that I am trying to place in an swf file called login.swf. My main swf has a camtasia loader in it and on the click of a button it calls for the login.swf to open in the loader. The login.swf works great if rendered as flash 5 - 7 and by itself. It does not work if rendered as flash 8 and called into a loader in another swf. I think if this little piece of code can get fixed then flash will not say there is an error and it should work if I put this piece of code in the first frame of the login.swf

this._lockroot = true;

Any help would be appreciated. Crazy at it seems this has obsessed me for 4 nights unti 4 am. Not much sleep... I'm tired and wish I could go to bed. Please help if anyone can.

All my love and appreciation to you in advance.

Love MacJedi

View Replies !    View Related
Piece Of Code Not Working When Exported To Player 7
Greetings.

I have a preloader code that gives me easing on the loadbar which makes a pretty nice effect, BUT... only when exported to Flash Player 6 (AS2)...


Code:
onClipEvent (enterFrame) {
loading = _parent.getBytesLoaded();
total = _parent.getBytesTotal();
percentage -= (percentage-((loading/total)*100))*.25;
per1 = int(percentage);
load_bar._width = per1*1.5;
if (percentage>99) {
_parent.gotoAndPlay(2);
}
}
When i do export to Player 7 the bar doesnt move neither the movie plays to frame 2... on 6 works like a charm!

This would be fine to export always to 6 but then some other code stops working when i do it.
I'm not much into deprecated code & all, so I really cant find the cause of incompatibility.

Maybe one of you gurus knows

Thanks in advance!

Jaime

View Replies !    View Related
AS3 - Flash To Php ? Looked And Tried Every Tutorial Or Piece Of Code.
so as i am in the process of learning tu comunicate with php... i'm trying just a simple piece of code.setting 2 variables in flash and echoing them with php.


Code:
var sendr:URLLoader = new URLLoader();

var urlReq:URLRequest = new URLRequest("D:/Test/ani.php");

urlReq.method = URLRequestMethod.POST;

var variables:URLVariables = new URLVariables();

variables.user = "aName";
variables.pass = "aPass";

urlReq.data = variables;

sendr.dataFormat = URLLoaderDataFormat.VARIABLES;

sendr.load(urlReq);



<?php
$user = $_POST ['user'];
$pass = $_POST ['pass'];
function scrie ($name , $value)
{
echo $name."=".$value;
}
scrie ("$user", "$pass");

?>

i am publising the swf file from the adobe cs3.then going into php designer and testing the file.i get this at the moment (i experimented with all tutorials regarding flash to php as3 on the internet and in some cases didn't get anything as an output)

i get this when i run ani.php
=Error in my_thread_global_end(): 1 threads didn't exit


can someone point me in the right direction please ? i've staid up all night trying to make this simple job.i don't even want to think when i will try php to flash.Thank you.

View Replies !    View Related
Using One Piece Of Code To Control A Groups Colour Tween
Hi guys

I have 5 simple movie clips on the stage. When each is rolled over, it simply fades into a set (the same for all) colour over 10 frames. Then back to normal on rollout. I have a stack of these to do however, can anyone point me in the right direction for 'including' the array of clips, and targetting them to tween the simple colour rollover/out via the one piece of AS?

I'm currently using a tweening class but may even scrap that given how light on it is.

Cheers

View Replies !    View Related
Translating A Piece Of Html Code Into Actionscript For Shopping Cart
Hi all,
I am designing a website in Flash 5.0 which requires a shopping cart. I have the coded button script but only in HTML format. Was wondering if anyone was able to translate to following code into actionscript format so as i can add it into the object actions in Flash.
Here it is:
ADD TO BASKET BUTTON CODE

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="https://www.paypal.com//en_AU/i/btn/x-click-but10.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="mjmspeedwayspares@bigpond.com.au">
<input type="hidden" name="item_name" value="MJM Speedway Spares">
<input type="hidden" name="amount" value="1000.00">
<input type="hidden" name="page_style" value="Primary">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="cn" value="Comment">
<input type="hidden" name="currency_code" value="AUD">
</form>
Thankyou and many thanks to whoever can help me out
Paul

View Replies !    View Related
[MX04] Scoping Help On A Piece Of Code-XML Driven Photo Gallery Loaded Into MC
I have a xml driven dynamic photo gallery. What I am trying to do is load this gallery into a MC on the main timeline so that I can control where the playback happens. The gallery works as a SWF but when I load it into a MC, it breaks and only a part loads up. Is this perhaps a scoping problem?

It does work if I let it load into a level but then it is in the wrong location. I'm guessing the MC adds a level to the scoping that I am not understanding. Help anyone?

the xml-driven gallery is a two frame FLA. The first frame has some variables and the start_mc that after loading, moves it to frame two.

Code on frame one of the XMLPhoto.FLA:


Code:
_global.a_th = 80;
_global.columns = 1;
_global.lines = 4;
var PhotoAlbum = {thumbs:[]};
photo_xml = new XML();
photo_xml.ignoreWhite = true;
stop();
code on frame two:


Code:
//QH_th is a holder MC with the same instance name
//QH_photo is a holder MC with the same instance name

photo_xml.onLoad = function() {
QH_th.html = true;
QH_th.htmlText = "<p align="center"></p>";
Photos_QuietHero(0);
};
_global.Photos_QuietHero = function(container) {
var photos = photo_xml.firstChild.childNodes;
var p_thumbs = photo_xml.firstChild.attributes.thumbs, p_photos = photo_xml.firstChild.attributes.QuietHero;
var i = container;
for (var l = 0; l<lines; l++) {
for (var c = 0; c<columns && i<photos.length; c++, i++) {
var thumb = QH_th.createEmptyMovieClip("thumb_"+i, i);
PhotoAlbum.thumbs.push(t);
thumb._y = l*a_th;
thumb.createEmptyMovieClip("photos", 1);
thumb.photos.loadMovie(p_thumbs+"/"+photos[i].attributes.thumb);
thumb.dimensions = photos[i].attributes;
thumb.onRelease = function() {
QH_photo._parent.alvo.unloadMovie();
QH_photo.dimensions = this.dimensions;
QH_photo.onEnterFrame = function() {
this._width += (this.dimensions.pixwidth-this._width)/3;
this._height += (this.dimensions.pixheight-this._height)/3;
QH_th._x = this._x+(this._width/2)+5;
QH_th._y = this._y-(this._height/2);
if (Math.round(this._width) == Math.round(this.dimensions.pixwidth) && Math.round(this._height) == Math.round(this.dimensions.pixheight)) {
this._width = this.dimensions.pixwidth;
this._height = this.dimensions.pixheight;
delete this.onEnterFrame;
this._parent.createEmptyMovieClip("alvo", 1);
this._parent.alvo._x = this._x-(this._width/2);
this._parent.alvo._y = this._y-(this._height/2);
this._parent.alvo.loadMovie(p_photos+"/"+this.dimensions.model_1);
}
};
};
}
}
};
photo_xml.load("photos.xml");
stop();
Can anyone help me with why this gallery won't load/work into a MC but does work if I load it into a level? Paths wrong, scoping wrong once it resides in a MC? Something else? Using Flash mx04/player7

View Replies !    View Related
Flash CS3, Downloading A Library Piece By Piece
When I make a new clip in a library ,or a new sound, I have an option to export it in a first frame. If I turn off that option, how can I export it later using actionscript? The problem is that a huge sound file, for example, would normally download itself before preloader has a chance to show up. So this is not a question of how can I download another file, but how can I choose which part of a swf to download first?

I hope that I don't sound too confusing.

View Replies !    View Related
Code To Long Any Other Way To Write This Code
i've been reading / learning actionscript 3 and i am making some simple practice .. but its too long any other way i can write this code it works fine but its too long.. thanks


Code:
package
{
import flash.display.Sprite;
import flash.text.*;
import flash.net.*;
import flash.events.Event;
import flash.display.StageScaleMode;
import flash.display.StageAlign;

public class Test extends Sprite
{
//private
private var navStyle:StyleSheet;

//NAV CONTAINER
private var navContainer:Sprite;

//HOME
private var home:Sprite;
private var homeText:TextField;

//COMPANY
private var company:Sprite;
private var companyText:TextField;

//SERVICES
private var services:Sprite;
private var servicesText:TextField;

//CONTACT
private var contact:Sprite;
private var contactText:TextField;

public function Test() {
init();
}
public function init():void {
loadStyleSheet();
initStage();
}
private function loadStyleSheet():void
{
var styleLoader:URLLoader = new URLLoader();
styleLoader.addEventListener(Event.COMPLETE , completeListener);
styleLoader.load(new URLRequest("css/test.css"));
}
private function completeListener (e:Event):void {
var navStyle:StyleSheet = new StyleSheet();
navStyle.parseCSS(e.target.data);

navContainer = new Sprite();

// HOME
home = new Sprite();
homeText = new TextField();

homeText.selectable = false;
homeText.antiAliasType = AntiAliasType.ADVANCED;
homeText.autoSize = TextFieldAutoSize.LEFT;
homeText.styleSheet = navStyle;
homeText.htmlText="<p class='navigation'><b>HOME</b></p>";
home.addChild(homeText);
addChild(home);

// COMPANY
company = new Sprite();
companyText = new TextField();

companyText.selectable = false;
companyText.antiAliasType = AntiAliasType.ADVANCED;
companyText.autoSize = TextFieldAutoSize.LEFT;
companyText.styleSheet = navStyle;
companyText.htmlText="<p class='navigation'><b>COMPANY</b></p>";
company.addChild(companyText);
addChild(company);

// SERVICES
services = new Sprite();
servicesText = new TextField();

servicesText.selectable = false;
servicesText.antiAliasType = AntiAliasType.ADVANCED;
servicesText.autoSize = TextFieldAutoSize.LEFT;
servicesText.styleSheet = navStyle;
servicesText.htmlText="<p class='navigation'><b>SERVICES</b></p>";
services.addChild(servicesText);
addChild(services);

// CONTACT
contact = new Sprite();
contactText = new TextField();

contactText.selectable = false;
contactText.antiAliasType = AntiAliasType.ADVANCED;
contactText.autoSize = TextFieldAutoSize.LEFT;
contactText.styleSheet = navStyle;
contactText.htmlText="<p class='navigation'><b>CONTACT</b></p>";
contact.addChild(contactText);
addChild(contact);

home.x = 0;
company.x = home.width + 20;
services.x = company.x + company.width + 20;
contact.x = services.x + services.width + 20;
navContainer.addChild(home);
navContainer.addChild(company);
navContainer.addChild(services);
navContainer.addChild(contact);
addChild(navContainer);

}

private function textFormat (navText:TextField, menuLabel:String):void {
navText = new TextField();
navText.selectable = false;
navText.embedFonts = true;
navText.antiAliasType =AntiAliasType.ADVANCED;
navText.type = TextFieldType.DYNAMIC;
navText.autoSize = TextFieldAutoSize.LEFT;
navText.styleSheet = navStyle;
navText.htmlText ="<p class='navigation'><b> "+menuLabel+" </b></p>";
}
private function initStage():void {
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
}

}
}

View Replies !    View Related
Large FLA - Need To Preload Piece By Piece... Help?
I'm taking over a project that another person was doing and they laid it out in on large timeline timeline.jpg (195.79 KiB) Viewed 281 times

View Replies !    View Related
[AS]mc Code Is Too Long
Last edited by rjm : 2005-07-16 at 09:36.
























Im working on setting up a photogallery for personal use. Ive figured out how to move the photos from one location to another. The problem is its takes a whole lot of code just for one photo. What I want to do is minimize the amount of code needed for each photo to go from point a to point b. Im sure theres someway to make a function that each photo could call to simplify things, But I really dont have the knowledge to do so.

If anyone could please check out the FLA file and let me know what I would have to do to simplify things that would be great!
-thanx in advance.

Photogallery.fla

View Replies !    View Related
Long Code Shortened
Hi,

How can I express this in a short form like a Math method, NO array please.

(myvar+1)+(myvar+2)+(myvar+3)+(my............

View Replies !    View Related
My Code Is Extremely Convoluted And Long.. Could I Get Help?
Hi forum,

I have a product showcase movie I'm creating (everyday). My problem is the way I write my code. I have found that it is quickest for me to write code in the timeline for stuff like this. I am hoping that somebody could assist me by downloading my FLA file, checking out my method of writing code and give me some tips on how I could write it in a more condensed way.. and also where it would work right! (I believe there is a timer coordination problem at the moment)

What the movie does is actually pretty simple, use a timer to advance through three different product lines for an online store. Also have three buttons that could perform the same advancement that the timer does. I am using Tweener for animations and I find that very quickly my code gets huge and unwieldy.

The catch with this movie is I want the button not to just immediately jump to the next product but to end the animation of the current product BEFORE jumping to the next product animation. That's where I'm getting caught.

Thank you for your help!

Here's the movie in it's current state: http://www.giantcomet.com/Brian/BigFly.html

And the FLA: http://www.giantcomet.com/Brian/BigFly.fla

View Replies !    View Related
Easy (I Think) MC Communication (looks Long But It's All Just Explanatory Code) =)
I am moving/scaling a MC called "menu" using this actionscript that is attatched to it:

onClipEvent (load) {
_root.targY = 190;
}
onClipEvent (enterFrame) {
cY = this._y;
difY = cY-_root.targY;
setProperty(this, _y, cY-(difY/5));
}
onClipEvent (load) {
_root.targX = 265;
}
onClipEvent (enterFrame) {
cX = this._x;
difX = cX-_root.targX;
setProperty(this, _x, cX-(difX/5));
}
onClipEvent (load) {
_root.scaleX = 100;
}
onClipEvent (enterFrame) {
sX = this._xscale;
difS = sX-_root.scaleX;
setProperty(this, _xscale, sX-(difS/5));
}
onClipEvent (load) {
_root.scaleY = 100;
}
onClipEvent (enterFrame) {
sY = this._yscale;
difSY = sY-_root.scaleY;
setProperty(this, _yscale, sY-(difSY/5));
}


The the user clicks a button with this script and the "menu" MC moves/scales:

on (release) {
_root.targY = 475;
}
on (release) {
_root.targX = 575;
}
on (release) {
_root.scaleX = 220;
}
on (release) {
_root.scaleY = 220;
}


When the "menu" MC reaches the coordinates that the above button sent it to, I want a button to then appear, giving the user the option to go "back". I have tried to get a "button" MC with "onClipEvent (enterFrame)" to check and see if _y=475 and if it is then have the "button" MC play to a certain frame and therefore reveal the back button. For some reason it doesn't work...maybe one of you gurus have a easier way of doing this?????????

View Replies !    View Related
Long Lines Of Code... How Can I Drop Down A Line?
total noob question here and I'm surprised this is the first time I've encountered this but...

I have a very long line of script that I'm having to scroll far to the right in the Actions panel to modify. What's the trick for keeping the code constant but dropping it down a line for easier access?


thanks!

View Replies !    View Related
SWF Works Slowly When Long EnterFrame Code
When I have a long code in a enterframe() action or when I have a background animation my swf works slowly (depends on the computer I run it). I saw on web movies wich doesen't work slowly on low memory computers even if they have background animation!

How can I solve this problem?

View Replies !    View Related
How To Break A Long Line Of Code Across Multiple Lines
(sorry this is such a stupid question but...)
I hate having a loooooooong line of code that i have to scroll left and right on so I like to break them to make the code more readable...

in asp I would do

variable = "this string is so long" & _
" that I broke it across" & _
" three lines


what is the actionscript way?

View Replies !    View Related
Sounds Takes Two Long To Long.. Why?
I have some sound loading from an external file, I don't understand why it takes so long to load... www.janav.com.
If you check my website three of the albums have songs...
album 6,7,8 have sound attached... but when you click you have to wait few seconds for the sound... I want to make my sound to load as fast as
www.benwisch.com website.

Any suggestions..?
I am not using linkage nor action script to load the soung I only used this code ..
on (release) {
stopAllSounds(); //to stop all previous sound
loadMovieNum("PaulinaRubio_Paulatina.swf", 2); // to load the picture first
loadMovieNum("music/paulina_music.swf",3); // to load the sound after the picture..

}

should I being using action scripts instead (like the kirupa tutorial), will this load very fast.

One more thing, the song is like 2 megabytes... should I use part of the song and then loop it.??/

Any suggestions will be appreciated...

Thanks,

Jana

View Replies !    View Related
Sounds Takes Two Long To Long.. Why?
I have some sound loading from an external file, I don't understand why it takes so long to load... www.janav.com.
If you check my website three of the albums have songs...
album 6,7,8 have sound attached... but when you click you have to wait few seconds for the sound... I want to make my sound to load as fast as
www.benwisch.com website.

Any suggestions..?
I am not using linkage nor action script to load the soung I only used this code ..
on (release) {
stopAllSounds(); //to stop all previous sound
loadMovieNum("PaulinaRubio_Paulatina.swf", 2); // to load the picture first
loadMovieNum("music/paulina_music.swf",3); // to load the sound after the picture..

}

should I being using action scripts instead (like the kirupa tutorial), will this load very fast.

One more thing, the song is like 2 megabytes... should I use part of the song and then loop it.??/

Any suggestions will be appreciated...

Thanks,

Jana

View Replies !    View Related
Long Long Load Time?
okay, I'm fairly new to Flash (newbie style) but I made a nice movie but when I load in into a page (with dreamweaver) it takes forever to load. The movie (.swf) is only 3k .... so whats the deal??

help?

'~-,_www.sketchmilitia.com_,~'

View Replies !    View Related
Newbie: Actionscript Long Lines Don't Wrap How To Break Long AS Lines?
Newbie question,
I'm writing .htmltext and have very long lines in my ActionScript panel I want to be able to
wrap the lines so I can read them without side scrolling. It's dumb but how do I wrap the
AS lines without starting an new line like I had entered a ";"

Thanks,

View Replies !    View Related
Who Wants A Piece Of The Pie?
greetings oh inteligent ones.
i am here to ask but one humble request... PLEASE HELP ME FIGURE THIS OUT!!! i need to create a "wheel" that has it's pie pieces filled in based on a number entry... (see lovely photoshop example)



the part i am having a hard time with is that i would need the pieces to fill in as shown in example.. (from the center out). anyway, you get the point. if one could also "set" the number of pieces that would need to be filled in that would be great.

any takers?

i don't know much about action scripting, but i am willing to learn. thanks in advance.

View Replies !    View Related
HELP With This Xml Piece PLEASE
K... I'm loosing my marbles trying to figure out how to get this to work. I have a fla that loads xml and duplicates my movie clip according to the amount of xml nodes. My problem is, I can't get the xml component I made to load the xml into the fields I want. I've attached a file. Please have a look and give me some advice. Thanks!

View Replies !    View Related
Need A Piece Of AS
ok, for example, I have this buttom that itīs black, when u rollover it turns red, I want to make it return to black when u stop the rollover, but from red to black....I donīt know if I explain myself, man I suck in english, hope u understand.... whatīs a possible AS for this, a simple one.... I know there are some threads about this, but can find one, thanks

View Replies !    View Related
Need A Piece Of AS
ok, for example, I have this buttom that itīs black, when u rollover it turns red, I want to make it return to black when u stop the rollover, but from red to black....I donīt know if I explain myself, man I suck in english, hope u understand.... whatīs a possible AS for this, a simple one.... I know there are some threads about this, but can find one, thanks

View Replies !    View Related
Piece Of Cake
I have a movie in the "over" and in the "down" frames of a button (two different movies). When you click the button it plays the "down" movie like it should but then it plays the "over" movie again on release. How do I remedy this.

View Replies !    View Related
Another Piece Of Cake, But Not For Me
need html code to control the size and menu items of the browser window (I`m talking about the first browser window that pops up when you log on the website, not the url opened within the flash movie)...
please help me, all the scripts I found didn`t work

[Edited by kubko on 09-21-2001 at 10:58 PM]

View Replies !    View Related
Piece Of Cake, Right? RIGHT?
This would be one of those questions that is very easy and quick anwserd by you expert guys....

How does the load movie script works...
I want to have a movie loaded into the main movie but I want to give it an exact size and let it play....
Do you understand??

Another question is....
I have got a button when you scroll over a movie clip plays and when you press it the other movie clip (from first question) has tpo play but then the button movie clip won't play...

I KNOW I KNOW i don't work with actionscript but can anybode explain to me how I fix these problems with zction script..
If you don't understand me please say and i will clear myself up a bit (I'm not a star in English because I live in The Netherlands)

I'm waiting for a reply... thank you...

Aram

View Replies !    View Related
C'mon This Should Be A Piece Of Cake For U
I'm reposting this questions, because I think the sollution most be easy. So I'll try again.

I've got some AS that shows text from a .TXT file in a Dynamic Text field, with scrollbar etc.... The FLash movie is on an HTML page.

Is there a way the manipulatie the ActionScript variable (loadVarDoc) that tells the rest of my Actionscript which .TXT file to get? For instance with JavaScript? (I want to incude de same movie an each HTML page, but show differte text on eacht page)

My Code:
loadVarDoc = "assets/swf/past.txt";
loadVarsText = new loadVars();
loadVarsText.load(loadVarDoc);
loadVarsText.onLoad = function(success) {
if (success) {
to the
scroller.text = this.var1;
} else {
scroller.text = "Data Not Found...";
}
};

View Replies !    View Related
What Is This Piece Of Actionscript Doing?
Hi
I'm setting up a Flash 6 player check, and I got this from one of the open source movies:


Code:
function Flash6Tester() {
}
Flash6Tester.prototype.testFlash6 = function() {
var gVersion;
gVersion = String(System.capabilities.version);
if (gVersion.length>3) {
return true;
} else {
return false;
}
};
Now, what I can't understand is what the .length>3 object is trying to check. It can't be the number of characters in the name of the player (they all have more than 3, right?), so what's the parameter it's checking to play or refuse?

Thanks for any pointers.

Cheers

View Replies !    View Related
Use A Piece Of A Image.
Hello ,

I was wondering if this is possible:

When a image is loaded in a flashmovie, that you can make a circle(by drawing) on the image and that you use the selected piece of the image in a other movie(symbol) that is moving(motion tween).

I hope this is possible and that someone can help me because i have been searching on the internet for days without any results

sorry for my bad english.
Regards,

Bas

View Replies !    View Related
Some Help With A Piece Of Coding..
Hello. I need some help with a piece of coding. On the click of a button, pics change position. However, I want the pics to change position on their own, without the use of any buttons. To give you a basic idea here is the code:

Button 1

on(press){
first_yPos = 0;
}

Button 2

on(press){
first_yPos = -250;
}

I'm quite sure there is a way for the pics to move with a/s, I just don't know how. Please help!! Thank you

View Replies !    View Related
Some Help With A Piece Of Coding..
Hello. I need some help with a piece of coding. On the click of a button, pics change position. However, I want the pics to change position on their own, without the use of any buttons. To give you a basic idea here is the code:

Button 1

on(press){
first_yPos = 0;
}

Button 2

on(press){
first_yPos = -250;
}

I'm quite sure there is a way for the pics to move with a/s, I just don't know how. Please help!! Thank you

View Replies !    View Related
Copyright Đ 2005-08 www.BigResource.com, All rights reserved