Ik heb hier twee keer hetzelfde actionscript waarbij ik bij de eerste alle "scroll" heb vervangen door "hallo". Er onder staat het origineel. In dit leuke scrollscript wordt verwezen naar een instance scroll, maar deze bestaat helemaal niet (tenminste als ik op dat icoontje rechtsboven in Flash klik waar je al die elements ziet. Dus ik dacht dan maakt hij hem gewoon aan, maar mijn test(alles vervangen door hallo) zorgt er voor dat het prog. niet meer werkt. Ik ben nu dus echt bezig de syntax van Actionscript te doorgronden door ervaring. Weet iemand waarom dit allemaal zo misloopt als je alle "scroll" door "hallo" vervangt?
Scene 1
border
frame 1, ( Copyright (c) 2001 UltraShock, Inc // David Bishop (david@frontmedia.co.uk). For more info regarding terms of use goto htt)
actions for frame 1
// Copyright (c) 2001 UltraShock, Inc // David Bishop (david@frontmedia.co.uk). For more info regarding terms of use goto http://ultrashock.com/legal/terms_of_use.htm
stop ();
Layer 6
frame 1
scrollclip
frame 1
Symbol Definition(s)
ScrollBarClip
Layer 2
frame 1
actions for frame 1
TextBox._height = TextBox_Height;
newhallo = -hallo._y;
function easeOut () {
hallopos = -hallo._y;
ratio = (content._height-TextBox_Height)/(TextBox_Height-hallo._height);
NewPos = Number((hallopos*ratio));
difY = newPos-content._y;
dif = hallopos-newhallo;
content._y = content._y+difY/3;
hallo._y = hallo._y+dif/3;
}
function easeDrag () {
hallopos = -hallo._y;
ratio = (content._height-TextBox_Height)/(TextBox_Height-hallo._height);
NewPos = Number((hallopos*ratio));
difY = newPos-content._y;
content._y = content._y+difY/3;
}
function stopper () {
if (hallo._y>90) {
hallo._y = 90;
newhallo = hallo._y;
} else if (hallo._y<0) {
hallo._y = 0;
newhallo = hallo._y;
} else {
hallo._y = hallo._y;
}
}
frame 2
actions for frame 2
if (dragmode == 1) {
easeDrag();
stopper();
} else {
easeOut();
stopper();
}
frame 3
actions for frame 3
prevFrame ();
play ();
Layer 9
frame 1
Layer 7
frame 1
actions for up button
on (press) {
newhallo = newhallo+30;
}
actions for up button
on (press) {
newhallo = newhallo-30;
}
Layer 3
frame 1
Layer 5
frame 1
actions for ScrollHandle
// inside this clip, is the handle which has all the positioning code on it. You need to adjust the numbers that are on the startdrag code for the left and right positioning of the dragbar
Layer 8
frame 1
Layer 1
frame 1
Layer 10
frame 1
actions for invis button
on (press) {
newhallo = 0;
}
actions for invis button
on (release) {
newhallo = -30;
}
actions for invis button
on (press) {
newhallo = -60;
}
actions for invis button
on (release) {
newhallo = -90;
}
up button
Layer 1
Up
scr_up
TextBox_Size
Layer 1
frame 1
ScrollHandle
Layer 1
frame 1
actions for Button
on (press) {
_root.mainclip.dragmode = 1;
startDrag (this, false, _parent.content._width+50, 0, _parent.content._width+50, (_parent.TextBox._height)-(this._height));
}
on (release, releaseOutside) {
barPos = _root.mainclip.hallo._y+15;
if (barPos>15, barPos<30) {
_root.mainclip.hallo._y = Math.ceil(0);
} else if (barPos>30, barPos<60) {
_root.mainclip.hallo._y = Math.ceil(30);
} else if (barPos>60, barPos<90) {
_root.mainclip.hallo._y = Math.ceil(60);
} else if (barPos>90) {
_root.mainclip.hallo._y = Math.ceil(90);
}
_root.mainclip.newhallo = -_root.mainclip.hallo._y;
_root.mainclip.hallopos = -_root.mainclip.hallo._y;
_root.mainclip.dragmode = 0;
stopDrag ();
}
Content
Layer 3
frame 1
Layer 2
frame 1
Layer 1
frame 1
invis button
Layer 1
Up
Over
Down
Hit
Button
Layer 1
Up
fade
Layer 1
frame 1
frame 10
actions for frame 10
stop ();
Scene 1
border
frame 1, ( Copyright (c) 2001 UltraShock, Inc // David Bishop (david@frontmedia.co.uk). For more info regarding terms of use goto htt)
actions for frame 1
// Copyright (c) 2001 UltraShock, Inc // David Bishop (david@frontmedia.co.uk). For more info regarding terms of use goto http://ultrashock.com/legal/terms_of_use.htm
stop ();
Layer 6
frame 1
scrollclip
frame 1
Symbol Definition(s)
ScrollBarClip
Layer 2
frame 1
actions for frame 1
TextBox._height = TextBox_Height;
newscroll = -scroll._y;
function easeOut () {
scrollpos = -scroll._y;
ratio = (content._height-TextBox_Height)/(TextBox_Height-scroll._height);
NewPos = Number((scrollpos*ratio));
difY = newPos-content._y;
dif = scrollpos-newscroll;
content._y = content._y+difY/3;
scroll._y = scroll._y+dif/3;
}
function easeDrag () {
scrollpos = -scroll._y;
ratio = (content._height-TextBox_Height)/(TextBox_Height-scroll._height);
NewPos = Number((scrollpos*ratio));
difY = newPos-content._y;
content._y = content._y+difY/3;
}
function stopper () {
if (scroll._y>90) {
scroll._y = 90;
newscroll = scroll._y;
} else if (scroll._y<0) {
scroll._y = 0;
newscroll = scroll._y;
} else {
scroll._y = scroll._y;
}
}
frame 2
actions for frame 2
if (dragmode == 1) {
easeDrag();
stopper();
} else {
easeOut();
stopper();
}
frame 3
actions for frame 3
prevFrame ();
play ();
Layer 9
frame 1
Layer 7
frame 1
actions for up button
on (press) {
newscroll = newscroll + 30;
}
actions for up button
on (press) {
newscroll = newscroll-30;
}
Layer 3
frame 1
Layer 5
frame 1
actions for ScrollHandle
// inside this clip, is the handle which has all the positioning code on it. You need to adjust the numbers that are on the startdrag code for the left and right positioning of the dragbar
Layer 8
frame 1
Layer 1
frame 1
Layer 10
frame 1
actions for invis button
on (press) {
newscroll = 0;
}
actions for invis button
on (release) {
newscroll = -30;
}
actions for invis button
on (press) {
newscroll = -60;
}
actions for invis button
on (release) {
newscroll = -90;
}
up button
Layer 1
Up
scr_up
TextBox_Size
Layer 1
frame 1
ScrollHandle
Layer 1
frame 1
actions for Button
on (press) {
_root.mainclip.dragmode = 1;
startDrag (this, false, _parent.content._width + 50, 0, _parent.content._width +50, (_parent.TextBox._height)-(this._height));
}
on (release, releaseOutside) {
barPos = _root.mainclip.scroll._y +15;
if (barPos >15, barPos <30) {
_root.mainclip.scroll._y = Math.ceil(0);
} else if (barPos > 30, barPos < 60) {
_root.mainclip.scroll._y = Math.ceil(30);
} else if (barPos > 60, barPos < 90) {
_root.mainclip.scroll._y = Math.ceil(60);
} else if (barPos > 90) {
_root.mainclip.scroll._y = Math.ceil(90);
}
_root.mainclip.newscroll = -_root.mainclip.scroll._y;
_root.mainclip.scrollpos = -_root.mainclip.scroll._y;
_root.mainclip.dragmode = 0;
stopDrag ();
}
Content
Layer 3
frame 1
Layer 2
frame 1
Layer 1
frame 1
invis button
Layer 1
Up
Over
Down
Hit
Button
Layer 1
Up
fade
Layer 1
frame 1
frame 10
actions for frame 10
stop ();
Scene 1
border
frame 1, ( Copyright (c) 2001 UltraShock, Inc // David Bishop (david@frontmedia.co.uk). For more info regarding terms of use goto htt)
actions for frame 1
// Copyright (c) 2001 UltraShock, Inc // David Bishop (david@frontmedia.co.uk). For more info regarding terms of use goto http://ultrashock.com/legal/terms_of_use.htm
stop ();
Layer 6
frame 1
scrollclip
frame 1
Symbol Definition(s)
ScrollBarClip
Layer 2
frame 1
actions for frame 1
TextBox._height = TextBox_Height;
newhallo = -hallo._y;
function easeOut () {
hallopos = -hallo._y;
ratio = (content._height-TextBox_Height)/(TextBox_Height-hallo._height);
NewPos = Number((hallopos*ratio));
difY = newPos-content._y;
dif = hallopos-newhallo;
content._y = content._y+difY/3;
hallo._y = hallo._y+dif/3;
}
function easeDrag () {
hallopos = -hallo._y;
ratio = (content._height-TextBox_Height)/(TextBox_Height-hallo._height);
NewPos = Number((hallopos*ratio));
difY = newPos-content._y;
content._y = content._y+difY/3;
}
function stopper () {
if (hallo._y>90) {
hallo._y = 90;
newhallo = hallo._y;
} else if (hallo._y<0) {
hallo._y = 0;
newhallo = hallo._y;
} else {
hallo._y = hallo._y;
}
}
frame 2
actions for frame 2
if (dragmode == 1) {
easeDrag();
stopper();
} else {
easeOut();
stopper();
}
frame 3
actions for frame 3
prevFrame ();
play ();
Layer 9
frame 1
Layer 7
frame 1
actions for up button
on (press) {
newhallo = newhallo+30;
}
actions for up button
on (press) {
newhallo = newhallo-30;
}
Layer 3
frame 1
Layer 5
frame 1
actions for ScrollHandle
// inside this clip, is the handle which has all the positioning code on it. You need to adjust the numbers that are on the startdrag code for the left and right positioning of the dragbar
Layer 8
frame 1
Layer 1
frame 1
Layer 10
frame 1
actions for invis button
on (press) {
newhallo = 0;
}
actions for invis button
on (release) {
newhallo = -30;
}
actions for invis button
on (press) {
newhallo = -60;
}
actions for invis button
on (release) {
newhallo = -90;
}
up button
Layer 1
Up
scr_up
TextBox_Size
Layer 1
frame 1
ScrollHandle
Layer 1
frame 1
actions for Button
on (press) {
_root.mainclip.dragmode = 1;
startDrag (this, false, _parent.content._width+50, 0, _parent.content._width+50, (_parent.TextBox._height)-(this._height));
}
on (release, releaseOutside) {
barPos = _root.mainclip.hallo._y+15;
if (barPos>15, barPos<30) {
_root.mainclip.hallo._y = Math.ceil(0);
} else if (barPos>30, barPos<60) {
_root.mainclip.hallo._y = Math.ceil(30);
} else if (barPos>60, barPos<90) {
_root.mainclip.hallo._y = Math.ceil(60);
} else if (barPos>90) {
_root.mainclip.hallo._y = Math.ceil(90);
}
_root.mainclip.newhallo = -_root.mainclip.hallo._y;
_root.mainclip.hallopos = -_root.mainclip.hallo._y;
_root.mainclip.dragmode = 0;
stopDrag ();
}
Content
Layer 3
frame 1
Layer 2
frame 1
Layer 1
frame 1
invis button
Layer 1
Up
Over
Down
Hit
Button
Layer 1
Up
fade
Layer 1
frame 1
frame 10
actions for frame 10
stop ();
Scene 1
border
frame 1, ( Copyright (c) 2001 UltraShock, Inc // David Bishop (david@frontmedia.co.uk). For more info regarding terms of use goto htt)
actions for frame 1
// Copyright (c) 2001 UltraShock, Inc // David Bishop (david@frontmedia.co.uk). For more info regarding terms of use goto http://ultrashock.com/legal/terms_of_use.htm
stop ();
Layer 6
frame 1
scrollclip
frame 1
Symbol Definition(s)
ScrollBarClip
Layer 2
frame 1
actions for frame 1
TextBox._height = TextBox_Height;
newscroll = -scroll._y;
function easeOut () {
scrollpos = -scroll._y;
ratio = (content._height-TextBox_Height)/(TextBox_Height-scroll._height);
NewPos = Number((scrollpos*ratio));
difY = newPos-content._y;
dif = scrollpos-newscroll;
content._y = content._y+difY/3;
scroll._y = scroll._y+dif/3;
}
function easeDrag () {
scrollpos = -scroll._y;
ratio = (content._height-TextBox_Height)/(TextBox_Height-scroll._height);
NewPos = Number((scrollpos*ratio));
difY = newPos-content._y;
content._y = content._y+difY/3;
}
function stopper () {
if (scroll._y>90) {
scroll._y = 90;
newscroll = scroll._y;
} else if (scroll._y<0) {
scroll._y = 0;
newscroll = scroll._y;
} else {
scroll._y = scroll._y;
}
}
frame 2
actions for frame 2
if (dragmode == 1) {
easeDrag();
stopper();
} else {
easeOut();
stopper();
}
frame 3
actions for frame 3
prevFrame ();
play ();
Layer 9
frame 1
Layer 7
frame 1
actions for up button
on (press) {
newscroll = newscroll + 30;
}
actions for up button
on (press) {
newscroll = newscroll-30;
}
Layer 3
frame 1
Layer 5
frame 1
actions for ScrollHandle
// inside this clip, is the handle which has all the positioning code on it. You need to adjust the numbers that are on the startdrag code for the left and right positioning of the dragbar
Layer 8
frame 1
Layer 1
frame 1
Layer 10
frame 1
actions for invis button
on (press) {
newscroll = 0;
}
actions for invis button
on (release) {
newscroll = -30;
}
actions for invis button
on (press) {
newscroll = -60;
}
actions for invis button
on (release) {
newscroll = -90;
}
up button
Layer 1
Up
scr_up
TextBox_Size
Layer 1
frame 1
ScrollHandle
Layer 1
frame 1
actions for Button
on (press) {
_root.mainclip.dragmode = 1;
startDrag (this, false, _parent.content._width + 50, 0, _parent.content._width +50, (_parent.TextBox._height)-(this._height));
}
on (release, releaseOutside) {
barPos = _root.mainclip.scroll._y +15;
if (barPos >15, barPos <30) {
_root.mainclip.scroll._y = Math.ceil(0);
} else if (barPos > 30, barPos < 60) {
_root.mainclip.scroll._y = Math.ceil(30);
} else if (barPos > 60, barPos < 90) {
_root.mainclip.scroll._y = Math.ceil(60);
} else if (barPos > 90) {
_root.mainclip.scroll._y = Math.ceil(90);
}
_root.mainclip.newscroll = -_root.mainclip.scroll._y;
_root.mainclip.scrollpos = -_root.mainclip.scroll._y;
_root.mainclip.dragmode = 0;
stopDrag ();
}
Content
Layer 3
frame 1
Layer 2
frame 1
Layer 1
frame 1
invis button
Layer 1
Up
Over
Down
Hit
Button
Layer 1
Up
fade
Layer 1
frame 1
frame 10
actions for frame 10
stop ();