PDA

Volledige versie bekijken : Sroll bar maken deel 2


attila
%Europe/Berlin %801 %2006, 19:14
Ben wat aan het toveren met maskers dat gaat nu maar nu krijg ik de volgende fout melding
Scene=Scene 1, Layer=Layer 50, Frame=1: Line 6: '{' expected
scrollBar.onPress = function():Void

Scene=Scene 1, Layer=Layer 50, Frame=1: Line 11: '{' expected
scrollBar.onRelease = function():Void

Scene=Scene 1, Layer=Layer 50, Frame=1: Line 16: '{' expected
function onEnterFrame():Void

Hoe los ik dit Op ??

Pimm
%Europe/Berlin %833 %2006, 20:00
Ik kan niet ruiken wat de rest van je code is, maar wellicht moet het zo:scrollBar.onPress = function():Void {
// Cadillac pimpin
}i.p.v. zo:scrollBar.onPress = function():Void
// Cadillac pimpin
}

attila
%Europe/Berlin %888 %2006, 21:20
Gehele code is dit

// scrollBar is de balk die we kunnen draggen.
// scrollBack is de achtergrond van scrollBar.
// scrollData is de inhoud; dus datgene dat moet bewegen zodra je de scroll-balk gebruikt.
// scrollMask is het masker van scrollData en dus tevens het zichtbare gebied.

scrollBar.onPress = function():Void {
{
this.startDrag(0, scrollBack._x + 10, scrollBack._y, scrollBack._x + 10, scrollBack._y + scrollBack._height - this._height);
};

scrollBar.onRelease = function():Void
{
this.stopDrag();
};

function onEnterFrame():Void
{
var scrollHeightPercentage:Number = (scrollBar._y - scrollBack._y) / (scrollBack._height - scrollBar._height);
scrollData._y += ((-(scrollData._height - scrollMask._height) * (scrollHeightPercentage) + scrollMask._y) - scrollData._y) / 2;
scrollBar._height = scrollBack._height * (scrollMask._height / scrollData._height);
};

Ruben!
%Europe/Berlin %933 %2006, 22:24
staan je export settings op 2.0?

waarschijnlijk niet:) in AS 1.0 worden dingen als :Void, :Boolean, enz. (strong typing) niet ondersteund:)

xtr0
%Europe/Berlin %935 %2006, 22:26
haal hier een "{" weg:
scrollBar.onPress = function():Void {
{
this.startDrag(0, scrollBack._x + 10, scrollBack._y, scrollBack._x + 10, scrollBack._y + scrollBack._height - this._height);
};

attila
%Europe/Berlin %944 %2006, 22:40
Hey

Alles Op een rijtje

1.Eerst maak je een masker zodat de scrollbar weet welk stuk hij moet scrollen !
Mijn vraag is dus hoe werk bovenstande code goed en moet ik de Scrollbar en het actionscript en het Masker in een Frame zetten of moeten deze Apart
Kom er namelijk helemaal niet meer uit

Deze code moet werken in Flash MX

Groetjes Gijs

Pimm
%Europe/Berlin %954 %2006, 22:53
Deze code moet werken in Flash MXDat gaat volgens mij niet lukken, maar onder je naam staat dat je Flash MX 2004 hebt en daarin gaat het wel. xtr0 heeft gelijk, haal die "{" weg.

attila
%Europe/Berlin %782 %2006, 18:47
Dat gaat volgens mij niet lukken, maar onder je naam staat dat je Flash MX 2004 hebt en daarin gaat het wel. xtr0 heeft gelijk, haal die "{" weg.

Heb Flash MX Helaas kan het daarin ook ??

xtr0
%Europe/Berlin %864 %2006, 20:44
werkt dit?
scrollBar.onPress = function()
{
this.startDrag(0, scrollBack._x + 10, scrollBack._y, scrollBack._x + 10, scrollBack._y + scrollBack._height - this._height);
};

attila
%Europe/Berlin %878 %2006, 21:04
zal eens proberen

attila
%Europe/Berlin %888 %2006, 21:19
Scene=Scene 1, Layer=Layer 46, Frame=1: Line 18: '{' expected
function onEnterFrame():Void

Scene=Scene 1, Layer=Layer 46, Frame=1: Line 19: Statement must appear within on/onClipEvent handler
{

Scene=Scene 1, Layer=Layer 46, Frame=1: Line 23: Statement must appear within on/onClipEvent handler
};

Krijg nu nog deze

xtr0
%Europe/Berlin %889 %2006, 21:20
ik zeg tog dat je een "{" moet weghalen bij de eerste functie ;).

attila
%Europe/Berlin %894 %2006, 21:27
ik zeg tog dat je een "{" moet weghalen bij de eerste functie ;).
Doe ik maar dan doet hij het nog niet :X

attila
%Europe/Berlin %895 %2006, 21:29
Scene=Scene 1, Layer=Layer 46, Frame=1: Line 10: '{' expected
scrollBar.onPress = function():Void

Scene=Scene 1, Layer=Layer 46, Frame=1: Line 12: Statement must appear within on/onClipEvent handler
this.startDrag(0, scrollBack._x + 10, scrollBack._y, scrollBack._x + 10, scrollBack._y + scrollBack._height - this._height);

Scene=Scene 1, Layer=Layer 46, Frame=1: Line 13: Statement must appear within on/onClipEvent handler
;

Scene=Scene 1, Layer=Layer 46, Frame=1: Line 15: '{' expected
scrollBar.onRelease = function():Void

Scene=Scene 1, Layer=Layer 46, Frame=1: Line 17: Statement must appear within on/onClipEvent handler
this.stopDrag();

Scene=Scene 1, Layer=Layer 46, Frame=1: Line 18: Statement must appear within on/onClipEvent handler
;

Scene=Scene 1, Layer=Layer 46, Frame=1: Line 20: '{' expected
function onEnterFrame():Void

Scene=Scene 1, Layer=Layer 46, Frame=1: Line 22: Statement must appear within on/onClipEvent handler
var scrollHeightPercentage:Number = (scrollBar._y - scrollBack._y) / (scrollBack._height - scrollBar._height);

Scene=Scene 1, Layer=Layer 46, Frame=1: Line 23: Statement must appear within on/onClipEvent handler
scrollData._y += ((-(scrollData._height - scrollMask._height) * (scrollHeightPercentage) + scrollMask._y) - scrollData._y) / 2;

Scene=Scene 1, Layer=Layer 46, Frame=1: Line 24: Statement must appear within on/onClipEvent handler
scrollBar._height = scrollBack._height * (scrollMask._height / scrollData._height);

Scene=Scene 1, Layer=Layer 46, Frame=1: Line 25: Statement must appear within on/onClipEvent handler
;
Fouten in de volgende code

// scrollBar is de balk die we kunnen draggen.
// scrollBack is de achtergrond van scrollBar.
// scrollData is de inhoud; dus datgene dat moet bewegen zodra je de scroll-balk gebruikt.
// scrollMask is het masker van scrollData en dus tevens het zichtbare gebied.

scrollBar.onPress = function():Void

this.startDrag(0, scrollBack._x + 10, scrollBack._y, scrollBack._x + 10, scrollBack._y + scrollBack._height - this._height);
;

scrollBar.onRelease = function():Void

this.stopDrag();
;

function onEnterFrame():Void

var scrollHeightPercentage:Number = (scrollBar._y - scrollBack._y) / (scrollBack._height - scrollBar._height);
scrollData._y += ((-(scrollData._height - scrollMask._height) * (scrollHeightPercentage) + scrollMask._y) - scrollData._y) / 2;
scrollBar._height = scrollBack._height * (scrollMask._height / scrollData._height);
;

attila
%Europe/Berlin %896 %2006, 21:31
Is hier geen goede Turtorial voor ofzo kom er geheel niet uit

Ruben!
%Europe/Berlin %912 %2006, 21:53
zoals ik al zei:
staan je export settings op 2.0?

waarschijnlijk niet in AS 1.0 worden dingen als :Void, :Boolean, enz. (strong typing) niet ondersteund
----------------------------
en "function onEnterFrame:Void" kan überhaupt niet.

xtr0
%Europe/Berlin %918 %2006, 22:02
niet alle { weghalen ;)
gebruik dit:
scrollBar.onPress = function():Void
{
this.startDrag(0, scrollBack._x + 10, scrollBack._y, scrollBack._x + 10, scrollBack._y + scrollBack._height - this._height);
}

scrollBar.onRelease = function():Void
{
this.stopDrag();
}

function onEnterFrame():Void
{
var scrollHeightPercentage:Number = (scrollBar._y - scrollBack._y) / (scrollBack._height - scrollBar._height);
scrollData._y += ((-(scrollData._height - scrollMask._height) * (scrollHeightPercentage) + scrollMask._y) - scrollData._y) / 2;
scrollBar._height = scrollBack._height * (scrollMask._height / scrollData._height);
}