Toon posts:

[actionscript] Waarom werkt dit niet?

Pagina: 1
Acties:

Verwijderd

Topicstarter
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 ();

  • OzBoz
  • Registratie: Maart 2000
  • Laatst online: 09-09 19:36

OzBoz

.:.H.:.I.:.P.:.

Begrijp ik het nou goed dat je de hulp vraagt voor een script wat je hebt zitten rippen of zie ik het weer te negatief?

My Fizion | My 3D prints | LinkedIn


  • RRX
  • Registratie: Mei 2000
  • Laatst online: 25-08 23:43

RRX

@life-

Op zondag 17 maart 2002 15:54 schreef gang-ster het volgende:
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?

[.. een stuk onnodige code ..]
instancename != symbolname

mijn T.net systeemspecspagina


Verwijderd

Topicstarter
1e reactie
Nee, ik zit dit niet te rippen. Ik vind dat de manual een beetje krom in elkaar zit en zit daarom zelf veel te experimenteren.

2e reactie
Waar zie je dat dan bijv.? Ik zag dat scroll een instance zou moeten zijn. Waar kan je trouwens alle instances op een rij zien? Op dit moment heb ik het dus nog NIET door.

Wel natuurlijk bedankt voor de reactie.

Verwijderd

Topicstarter
Wil er iemand reageren? Het kan hoor....

  • edwinistrator
  • Registratie: December 2000
  • Laatst online: 23-03-2022
ctrl + i dan krijg je een pannel met een tabje genaam "instance" waar je een instancename kan geven aan je movieclip. moet je wel je movieclip selecteren

Verwijderd

Ik zou best willen reageren, maar ik heb geen zin om dat blok code door te lezen, zeker omdat ie niet netjes indented is.

  • edwinistrator
  • Registratie: December 2000
  • Laatst online: 23-03-2022
Op zondag 17 maart 2002 15:54 schreef gang-ster het volgende:
In dit leuke scrollscript wordt verwezen naar een instance scroll, maar deze bestaat helemaal niet...
die bestaat dus wel en die staat hier:
Afbeeldingslocatie: http://www.operation3.com/plaatjes/scroll.gif

Verwijderd

Op maandag 18 maart 2002 17:43 schreef B-Top het volgende:
Ik zou best willen reageren, maar ik heb geen zin om dat blok code door te lezen, zeker omdat ie niet netjes indented is.
Precies, zet je code gewoon even hoe het standaard in Flash komt, en zet cursief bij welke frames / objects het hoort, want denk dat iedereen afknapt bij het zien van 100 regels niet geordend actionscript en zooi door elkaar, als het goede is wil ik wel even kijken,

Verwijderd

Topicstarter
Bedankt voor het antwoord. Maar nu zit ik dus nog met een ding. Kun je ook alle instances onder elkaar op een scherm laten zien? Jullie hebben wel gelijk over die code.

Verwijderd

Topicstarter
Op dinsdag 19 maart 2002 09:42 schreef gang-ster het volgende:
Bedankt voor het antwoord. Maar nu zit ik dus nog met een ding. Kun je ook alle instances onder elkaar op een scherm laten zien? Jullie hebben wel gelijk over die code.
Ja, dat wil ik ook wel weten. >:)

  • BtM909
  • Registratie: Juni 2000
  • Niet online

BtM909

Watch out Guys...

Op dinsdag 19 maart 2002 12:58 schreef gang-ster het volgende:

[..]

Ja, dat wil ik ook wel weten. >:)
Niet zo ongeduldig :(. Misschien kan je beter je tijd benutten door zelf nog goed te kijken en zoeken (hint: F1)

Ace of Base vs Charli XCX - All That She Boom Claps (RMT) | Clean Bandit vs Galantis - I'd Rather Be You (RMT)
You've moved up on my notch-list. You have 1 notch
I have a black belt in Kung Flu.


Verwijderd

Op dinsdag 19 maart 2002 12:58 schreef gang-ster het volgende:

[..]

Ja, dat wil ik ook wel weten. >:)
Waar heb je het over? ?? ?

Verwijderd

Topicstarter
Ik wil alle instances op een rij hebben staan.
Pagina: 1