Tomasz Stępień

Tomasz Stępień Prezes, Kancelaria
Planowania
Finansowego

Temat: problem ze skyptem w template

Witam, Kupiłem template'a z wyskakującymi okienkami "read more"


każdy button odwołuje się do tej samej "tresci" i nie mam pojęcia jak zmienić, aby kolejne buttony w sekcji "aktualności" na mojej stronie odwoływały się do innych frame'ów.


import mx.transitions.*;
import mx.transitions.easing.*;
mcScroll.setMask(maskPopup);
//------------- Constants ---------------//
var popupStartX = 200;
var popupEndX = 500
var popupStartY = _root.mcPopup._y;
var popupEndY = 400
var maskPopupHideHeight = mcTitleBar._height+2;
var brdHideHeight = mcTitleBar._height+4;
var brdNormHeight = mcBrdPopup._height+2;
var maskPopupScale = (100*maskPopupHideHeight)/maskPopup._height;
var brdScaleHide = (100*brdHideHeight)/mcBrdPopup._height;
var brdScaleNorm = (100*brdNormHeight)/mcBrdPopup._height;
var flagPopup = false;
var flagHidePopup = false;
var flagDragTitleBar = true;
btnFalse.useHandCursor = false;
if (flagDragTitleBar == false) {
mcTitleBar.useHandCursor = false;
}
//
//----------- hide popup functions ------------//
f_popupHide = function () {
if (flagHidePopup == false) {
var tweenMaskYScale = new Tween(maskPopup, "_yscale", Regular.easeOut, maskPopup._yscale, maskPopupScale, .6, true);
var tweenBgrYScale = new Tween(mcBgrPopup, "_yscale", Regular.easeOut, mcBgrPopup._yscale, maskPopupScale, .6, true);
var tweenBrdYScale = new Tween(mcBrdPopup, "_yscale", Regular.easeOut, mcBrdPopup._yscale, brdScaleHide, .6, true);
tweenMaskYScale.onMotionFinished = function() {
flagHidePopup = true;
};
}
if (flagHidePopup == true) {
var tweenMaskYScale = new Tween(maskPopup, "_yscale", Regular.easeOut, maskPopup._yscale, 100, .6, true);
var tweenBgrYScale = new Tween(mcBgrPopup, "_yscale", Regular.easeOut, mcBgrPopup._yscale, 100, .6, true);
var tweenBrdYScale = new Tween(mcBrdPopup, "_yscale", Regular.easeOut, mcBrdPopup._yscale, brdScaleNorm, .6, true);
tweenMaskYScale.onMotionFinished = function() {
flagHidePopup = false;
};
}
};
//
//----------- functions appear/disappear popup ------------//
f_popup = function () {
mcScroll.f_updateScroll();
if (flagPopup == false) {
maskPopup._yscale = 100;
mcBgrPopup._yscale = 100;
mcBrdPopup._yscale = brdScaleNorm;
_root.mcPopup._x = popupEndX;
_root.mcPopup._y = popupEndY;
flagHidePopup = false;
flagPopup = true;
_root.mcPopup._visible = true;
}
var tweenAlphaPopup = new Tween(_root.mcPopup, "_alpha", None.easeOut, 0, 100, .6, true);
};
f_popupDisapp = function () {
//var tweenAlphaPopup = new Tween(_root.mcPopup, "_alpha", None.easeOut, _root.mcPopup._x, 0, .4, true);

//tweenAlphaPopup.onMotionFinished = function() {
flagPopup = false;
_root.mcPopup._x = popupStartX;
_root.mcPopup._alpha = 0;
_root.mcPopup._visible = false;
//};
};
//
//----------- button close popup ------------//
btnClose.onRollOver = function() {
this.gotoAndPlay('over');
};
btnClose.onRollOut = btnClose.onReleaseOutside=function () {
this.gotoAndPlay('out');
};
btnClose.onRelease = function() {
f_popupDisapp();
};
//
//----------- button hide popup ------------//
btnHide.onRollOver = function() {
this.gotoAndPlay('over');
};
btnHide.onRollOut = btnHide.onReleaseOutside=function () {
this.gotoAndPlay('out');
};
btnHide.onRelease = function() {
f_popupHide();
};
//
//----------- button title bar ------------//
mcTitleBar.onPress = function() {
if (flagDragTitleBar == true) {
_root.mcPopup.startDrag();
}
};
mcTitleBar.onRelease = function() {
if (flagDragTitleBar == true) {
_root.mcPopup.stopDrag();
}
};
Tomasz Stępień

Tomasz Stępień Prezes, Kancelaria
Planowania
Finansowego

Temat: problem ze skyptem w template

mcScroll.setMask(maskScroll);
//---------------- Constants ------------------//
var dragX = mcDragger._x;
var topY = mcDragger._y;
var positionDragger = topY;
var draggingHeigth = mcBgrDragger._height-mcDragger._height;
var bottomY = mcBgrDragger._y+draggingHeigth;
var scrollStartY = mcScroll._y;
var positionScroll = mcScroll._y;
var scrollEndY = scrollStartY-mcScroll._height+mcBgrDragger._height;
var deltaScroll = scrollStartY-scrollEndY;
var scrollStep = deltaScroll/100;
var draggerStep = draggingHeigth/100;
var speed = 6;
var deltaMouseWheel = 8;
var deltaBtn = 20;
//
f_updateScroll = function () {
mcScroll.gotoAndStop(_root.numPopup);
mcTitle.gotoAndStop(_root.numPopup);
mcDragger._y = topY;
positionDragger = topY;
mcScroll._y = scrollStartY;
positionScroll = scrollStartY;
scrollEndY = scrollStartY-mcScroll._height+mcBgrDragger._height;
deltaScroll = scrollStartY-scrollEndY;
scrollStep = deltaScroll/100;
if (mcScroll._height<mcBgrDragger._height) {
mcBgrDragger._visible = false;
mcDragger._visible = false;
btnBottom._visible = false;
btnTop._visible = false;
} else {
mcBgrDragger._visible = true;
mcDragger._visible = true;
btnBottom._visible = true;
btnTop._visible = true;
}
};
//
//---------------- Dragging ------------------//
mcDragger.onRollOver = function() {
this.gotoAndPlay('over');
};
mcDragger.onRollOut = function() {
this.gotoAndPlay('out');
};
mcDragger.onPress = function() {
this.startDrag(false, dragX, topY, dragX, bottomY);
dragging();
};
mcDragger.onRelease = mcDragger.onReleaseOutside=function () {
this.stopDrag();
};
function dragging() {
delete mcScroll.onEnterFrame;
mcScroll.onEnterFrame = function() {
procentDragger = Math.round(mcDragger._y/draggerStep);
positionScroll = -Math.floor(deltaScroll*procentDragger/100);
mcScroll._y += (positionScroll-mcScroll._y)/speed;
if (Math.abs(positionScroll-mcScroll._y)<1) {
mcScroll._y = positionScroll;
}
};
}
//
//---------------- MouseWheel ------------------//
wheelMover = new Object();
wheelMover.onMouseWheel = function(mover) {
if (maskScroll.hitTest(_root._xmouse, _root._ymouse, false)) {
positionScroll += mover*deltaMouseWheel;
noDragging();
}
};
Mouse.addListener(wheelMover);
//
//---------------- Buttons Top/Bottom ------------------//
btnTop.onRollOver = function() {
this.gotoAndPlay('over');
};
btnTop.onRollOut = function() {
this.gotoAndPlay('out');
};
btnTop.onPress = function() {
onEnterFrame = function () {
positionScroll += deltaBtn;
noDragging();
};
};
btnTop.onRelease = btnTop.onReleaseOutside=function () {
delete onEnterFrame;
};
//
btnBottom.onRollOver = function() {
this.gotoAndPlay('over');
};
btnBottom.onRollOut = function() {
this.gotoAndPlay('out');
};
btnBottom.onPress = function() {
onEnterFrame = function () {
positionScroll -= deltaBtn;
noDragging();
};
};
btnBottom.onRelease = btnBottom.onReleaseOutside=function () {
delete onEnterFrame;
};
//
//---------------- function noDragging ------------------//
function noDragging() {
if (positionScroll<scrollEndY) {
positionScroll = scrollEndY;
}
if (positionScroll>scrollStartY) {
positionScroll = scrollStartY;
}
delete mcScroll.onEnterFrame;
mcScroll.onEnterFrame = function() {
procentScroll = Math.round(mcScroll._y/scrollStep);
positionDragger = -Math.floor(draggingHeigth*procentScroll/100);
mcDragger._y += (positionDragger-mcDragger._y)/speed;
mcScroll._y += (positionScroll-mcScroll._y)/speed;
if (Math.abs(positionScroll-mcScroll._y)<1) {
mcScroll._y = ositionScroll;
delete this.onEnterFrame;
}
};
}
Tomasz Stępień

Tomasz Stępień Prezes, Kancelaria
Planowania
Finansowego

Temat: problem ze skyptem w template

on (rollOver) {
gotoAndPlay("s1");
}
on (rollOut) {
gotoAndPlay("s2");
}
on (release) {
_root.mcPopup.f_popup();
}
//

to są trzy skrypty w którym wydaje mi się, że jest rozwiązanie zagadki.
pierwszy skrypt jest ukryty w symbolu "popup" drugi"popupscroll" trzeci pod guzikiem "readme"

jestem amatorem i nie znam AC3 tylko kopoiuj i wklej....

Dziękuję z gróry za pomoc
POzdrawiam

Następna dyskusja:

problem z Adobe Flash Play...




Wyślij zaproszenie do