Having Trouble With Tween Navigation (New To Flash)
http://douglas.mackenzie.natcoll.net...lash/index.swfhttp://douglas.mackenzie.natcoll.net...lash/index.flais the link to the flash file.The problem I am having is that it only tweens once. I wanted to be able to go back and forth - It just doesn't seem to respond after the first click.Also it always goes the same way no matter where it's clicked. Can anyone work this out?If anyone has time to read over this code it would be greatly appreciated.Thanks Code: import fl.transitions.Tween;import fl.transitions.easing.*;var xTween:Tween;var yTween:Tween;var castMc:cast = new cast;addChild(castMc);castMc.x = -580;castMc.y = 145;//castMc.buttonMode = true;var trailerMc:trailer = new trailer;addChild(trailerMc);trailerMc.x = 120;trailerMc.y = 145;//trailerMc.buttonMode = true;var datesMc:dates = new dates;addChild(datesMc);datesMc.x = 820;datesMc.y = 145;//datesMc.buttonMode = true;castMc.addEventListener(MouseEvent.CLICK, navigate);trailerMc.addEventListener(MouseEvent.CLICK, navigate);datesMc.addEventListener(MouseEvent.CLICK, navigate);var castXposFarLeft:Number = -1280;var castYposFarLeft:Number = 145;var castXposLeft:Number = -580;var castYposLeft:Number = 145;var castXposMiddle:Number = 120;var castYposMiddle:Number = 145;var trailerXposLeft:Number = -580;var trailerYposLeft:Number = 145;var trailerXposMiddle:Number = 120;var trailerYposMiddle:Number = 145;var trailerXposRight:Number = 820;var trailerYposRight:Number = 145;var datesXposFarRight:Number = 1280;var datesYposFarRight:Number = 145;var datesXposRight:Number = 820;var datesYposRight:Number = 145;var datesXposMiddle:Number = 120;var datesYposMiddle:Number = 145;function navigate(event:MouseEvent):void {if(event.currentTarget.name == "castMc") {setTweenCast(castXposMiddle, castYposMiddle);setTweenTrailer(trailerXposRight, trailerYposRight);setTweenDates(datesXposFarRight, datesYposFarRight);}else if(event.currentTarget.name == "trailerMc") {setTweenCast(castXposLeft, castYposLeft);setTweenTrailer(trailerXposMiddle, trailerYposMiddle);setTweenDates(datesXposRight, datesYposRight);}else(event.currentTarget.name == "datesMc") {setTweenCast(castXposFarLeft, castYposFarLeft);setTweenTrailer(trailerXposLeft, trailerYposLeft);setTweenDates(datesXposMiddle, datesYposMiddle);}//trace(event.currentTarget.name);}function setTweenDates(tweenX:Number, tweenY:Number):void {xTween = new Tween(datesMc, "x", Strong.easeOut, datesMc.x, 0, 4, true);yTween = new Tween(datesMc, "y", Strong.easeOut, datesMc.y, 145, 4, true);xTween.begin = datesMc.x;yTween.begin = datesMc.y;xTween.finish = tweenX;yTween.finish = tweenY;xTween.start();yTween.start();}function setTweenCast(tweenX:Number, tweenY:Number):void {xTween = new Tween(castMc, "x", Strong.easeOut, castMc.x, 0, 4, true);yTween = new Tween(castMc, "y", Strong.easeOut, castMc.y, 145, 4, true);xTween.begin = castMc.x;yTween.begin = castMc.y;xTween.finish = tweenX;yTween.finish = tweenY;xTween.start();yTween.start();}function setTweenTrailer(tweenX:Number, tweenY:Number):void {xTween = new Tween(trailerMc, "x", Strong.easeOut, trailerMc.x, 0, 4, true);yTween = new Tween(trailerMc, "y", Strong.easeOut, trailerMc.y, 145, 4, true);xTween.begin = trailerMc.x;yTween.begin = trailerMc.y;xTween.finish = tweenX;yTween.finish = tweenY;xTween.start();yTween.start();}
ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 02-01-2009, 03:57 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Trouble With 1st Kirupa Flash 8 Tween Tutorial
Hi,
I'm on a Mac and a Flash MX 2004 user. I attempted to do Kirupa's very basic animation tweening tutorial to get myself going with Flash 8, but I cannot get it to work.
The motion works fine, but when I introduced the alpha part, it started behaving erratically. It just won't fade IN.
I am familiar and comfortable with animation tweens involving motion and fades in MX 2004...
I tried just doing a fade in for a single letter, not even inside a movie clip (as the tutorial has you do), and didn't use motion -- just a fade in: Can't even get that to work.
Any ideas? Some silly thing I overlooked??
Thanks!
SL
Using The Tween Class With W/ Navigation Buttons Flash CS3 Pro
I'm having a little trouble with my navigation buttons. I used a tutorial on using the tween class to cause my buttons on my menu to grow and shrink onRollOvers & onRollOuts.
The actionscript is 2.0 and is in a action layer.
I need the buttons to change to another page on the web site when clicked.
I used an invisible button. The button code is on it's own layer.
The problem is the invisible button covers or hides the effect of the tween class function. It will not grow and shrink unless the pointer rolls over a portion the invisible button is not covering.
How do I get the effect I want using the tween class and the ability to change pages without that problem?
Trouble With Flash MX 2004 Button Navigation
Hello
This is my first time on this site and if I am posting this in the incorrect spot then please direct me elsewhere. I am trying to create simple button navigation in Flash MX 5. In the tutorial on your site and in the book I have checked out (the book is on Flash4 though) it says you can simply click on the button and then select Modify>Instance, choose the actions tab, and select from a variety of On (mouse event) actions. Flash MX 5 does not work like this and I have tried going in to the actions and selecting the action scipt commands by hand but I keep receiving script errors. I am fairly new to the program and the way the manual and a couple tutorials I have looked at make it seem rather simple to use buttons to navigate between scenes and frames of a flash document. I seem to be missing how to get to this simple mouse action/naviation menu. To me it seems they have actually made it harder not any easier in the transition from 4 to 5.
Thanks for any help you may be able to offer,
ebarr
Trouble With Flash MX 2004 Button Navigation
Hello
This is my first time on this site and if I am posting this in the incorrect spot then please direct me elsewhere. I am trying to create simple button navigation in Flash MX 5. In the tutorial on your site and in the book I have checked out (the book is on Flash4 though) it says you can simply click on the button and then select Modify>Instance, choose the actions tab, and select from a variety of On (mouse event) actions. Flash MX 5 does not work like this and I have tried going in to the actions and selecting the action scipt commands by hand but I keep receiving script errors. I am fairly new to the program and the way the manual and a couple tutorials I have looked at make it seem rather simple to use buttons to navigate between scenes and frames of a flash document. I seem to be missing how to get to this simple mouse action/naviation menu. To me it seems they have actually made it harder not any easier in the transition from 4 to 5.
Thanks for any help you may be able to offer,
ebarr
_x Tween Trouble
I am unable to tween into a specific position. Here is the code that I am using.
if (_root.arrow._x>330) {
_root.arrow._x-=70;
gotoAndPlay("loop");
} else{
gotoAndStop(1);
}
When I replace "-=70" with "--" I can hit the exact spot that I am going for, but it does not move fast enough.
Any suggestions would be greatly appreciated.
Thanks
Multiple Tween Trouble
Ok are you sopposed to have more then 1 dif. kind of tweens on 1 layer....or are u sopposed to make a seperate layer 4 a seperate tween
thx alot 4 the help
this ? is bothering me
Fade In Tween Trouble...
maybe i'm completely crazy... i'm trying to tween a mc symbol... just a simple alpha fade... on the main timeline of a swf... he symbol is made of dynamic text embeded... but of two different text boxes... converted to grapic symbols... on two different layers... in the mc symbol... is there something wrong with me...? it wont tween... i've tried it with one layer... i've tried it grouping them... i need the fonts to be two different sizes in the one symbol...
help... it's probably something silly...
[FCS3] Tween Trouble In CS3
My Flash experience is in using Flash8, and I'm currently using CS3 for the first time. I am however using AS2.0, not 3.0.
I'm using several motion tweens between various keyframes in a layer of a movieclip. Each tween is from a keyframe with a symbol instance set at color: Alpha, 0% and the same symbol with color: Alpha, 100%. These appear to be functioning properly. Below that layer I have a layer with almost identical "static" symbols. The intended effect being part of the swf "fades in."
However, by the second frame as the alpha starts to tween in, the entire image (including the normal static layer) is washed out as if the tween layer has 100% opacity over the static fill layer.
I've done the exact same thing in the past using Flash8, so maybe I'm just forgetting something. Thanks for any help!
Tween Class Trouble
An swf is worth a thousand words, so....
Please go to http://www.datapixel.eu/datapixel.htm
and watch yourself. When you click on "Apri Menu" (Open Menu in english) an animation made with the Tween class shows.
It should enlarge the green panel in order to show the buttons. And IT DOES! .... sometimes.
Instead sometimes the animation stops prematurely and the menu is not correctly viewed. Do you know what's happening?
Thanks.
Trouble With The Tween Class
I'm having trouble with this code, it's for tweening Thumbnails in a photo gallery application I'm building:
Code:
var tween:Tween = new Tween(Thumbnails[Thumbnails.cur_thumbnail], "_alpha", mx.transitions.easing.Strong.easeIn, 40, 100, 1, true);
Thumbnails.cur_thumbnail = new_thumbnail;
What happens is while the tween variable is tweening the value of Thumbnails.cur_thumbnail changes therefore cutting off the tween before it gets started or at least I'm assuming this is what's happening.
How do I get around this? Thanks.
Tween Class Trouble
Well, firstly, excuse my poor english... I guess its not so good, but I hope you can understand me.
Well, I have imported the tween class at my .fla file with:
-------
import mx.transitions.Tween;
import mx.transitions.easing.*;
-------
as everywhere says it must be done. Later, I use:
-------
ROLLOVER:
var tw:Tween=new Tween(plano_mc, "_xscale", mx.transitions.easing.Elastic.easeOut,40, 100, 40, false);
var tw2:Tween=new Tween(plano_mc, "_yscale", mx.transitions.easing.Elastic.easeOut,40, 100, 50, false);
-------
inside a function that i call on the rollover method for the movieClip I want to tween.
The trouble comes in the rollOut method, where I have this code:
-------
ROLLOUT:
var tw:Tween=new Tween(plano_mc, "_xscale", mx.transitions.easing.Elastic.easeOut, 100,40, 1, true);
var tw2:Tween=new Tween(plano_mc, "_yscale", mx.transitions.easing.Elastic.easeOut, 100,40, 1, true);
-------
After the user rolls out, and even after the rollOut tween is well done, it resizes to the 100%, even if I'm out of the hitArea for the rollOver. All this instead of staying at the 40% of _xscale and _yscale, that is what I wanted the class to do (you can see it in the parameters of the tween).
It only happens in the rollOut method, because the rollOver doesn't get resized after is called as well as the rollOut... It should be logical if it should happen at both methods, but it just happens at RollOut, and even, each time I rollOut, is just one (or both sometimes) property which gets resized (sometimes the _yscale, other times the _xscale....). Is there any explanation for this???
I want to erase this error, that I can't find why happens. My only explanation is that Robert Penner did a bad class, but I don't really trust it because he is a Flash master and I'm just a beginner, so, please
pleeeeeaaaase!, anybody help me!
Thank you very much!
Tween Class Trouble
I have 2 tweens. I want my first one to be around 50% completed to start my second one. How do I do that ?
Code:
var Tween_right:Tween = new Tween(_root.mc_holder.mc_backgroundBlue, "_x", Strong.easeOut, 0, 525, 1, true);
var AlphaUp:Tween = new Tween(obj, "_alpha", Regular.easeOut, 0, 100, 1, true);
AlphaUp.stop();
Trouble With HitTestPoint And Tween
Hi guys,
I'm having a trouble with hitTestPoint and tween. Well, if you look at the code you will understand what I am trying to archive here.
---------------------
var action:Tween;
target01.alpha = 0.6;
target01.addEventListener(Event.ENTER_FRAME, transition01);
function transition01(event:Event):void {
if (target01.hitTestPoint(mouseX, mouseY, true)) {
action = new Tween(target01, "alpha", Strong.easeOut,0.6, 1, 1, true);
} else {
action = new Tween(target01, "alpha", Strong.easeOut,1, 0.6, 1, true);
}
}
---------------------
Yes, that's right. I'm trying to make the movie clip 'target01' to fade in once the mouse pointer roll-overs, and fades out when roll-out. But tween actions don't work...
Yes, I did MouseEvents instead, but it is not the way I want it.. Please help me outta here guys.
Trouble With A Shape Tween
Howdy guys,
I got this problem with a shape tween in my project. Its basically a CBt type of deal. But the problem is when u click on a button and go to the page, a shape tween of a semi-transparent box betting bigger is supposed to happen, it is also a movie clip. It happens inside of it. It happens in the flash file, but when I export it it goes all wierd. The box is supposed to come from the top left and go to the right bottom. But when it plays it only shows the right side line.
Are both the timelines supposed to be the same amount. There both 10 frames. Any kind of help will be greatly appericated.
thanks
Tween Class Trouble
I don't use Tween class often, so don't scold me if this is an obvious question.
When I set up a simple Tween, it works if I assign a specific object's instance name as the object to tween. But when doing it inside a for loop, it doesn't work. Yet everything else within the for loop works. I've tested every variable, and it's the object name that doesn't work. Here is a simplified version of the code. Someone please tell me what I've done wrong.
Attach Code
import mx.transitions.Tween;
import mx.transitions.easing.*;
for (var k:Number = 1; k<15; k++) {
var dakine = this["letter"+k];
dakine.onPress = function() {
this._xscale = this._yscale=90;
this.startX = this._x;
this.startY = this._y;
startDrag(this);
};
dakine.onRelease = dakine.onReleaseOutside=function () {
stopDrag();
this._xscale = this._yscale=100;
var letterUp:Tween = new Tween(this, "_x", Bounce.easeOut, this._x, this.startX, 2000);
};
}
Navigation Trouble
I'm trying to make a navigation system for a site. But what i have tried won't work. This is what its like:
[BUTTON 1] [BUTTON 2] [BUTTON 3]
:::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::
::::::::::::::::content:::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::
What happens is when it is loaded the content moves from offscreen form the right into the center but when you click on another button it moves off to the right and the new content comes in from off screen form the right.
One content on the timeline looks like this
[.]----->[.][.][.]----->[.]
The first tween is it going on the keyframe in the middle has stop() in it and the other tween is it going off.
the script in the buttons is
like
on.mouserealase
i=0; '0 is in button 1, 1 is in button etc
play()
in the end frame of the content moving out is like this
If {
i=0;
gotoANDplay(40) 'this is the first frame of content 1
}
else
i=1;
GotoANDplay(80) 'the first frame of content 2
else
i=2;
GotoAndPlay(100)
Else
STOP
[I know the code is setout proberly with the right symbols { but it is just for a general gist.
But what happens is it will just go right back to the start of the movie
any help appreciated.
THANKS
More Navigation Trouble...
U guys will remember I was having a problem before with enabling/disabling buttons for navigation on different levels. I'm having the same problem again but with a different movie. This one is a little more complex. Has much more action script and pizzaz. Took some stuff from FK and a lot of my own. It will be a great site, soon as I can get the buttons working again. The buttons are in a movie instance, that is loaded into another instance that is loaded into my main movie. They are loading external page.swf into a target in the main movie _root. To say the least it seems I cannot get the timelines/buttons/movies/whatever to communicate back and forth the btn.enabled=; or the btn._alpha=; tags. I've tried every combination of _levelx, _parent, & _root identifiers. Still no function, if you think you can help I will mail you the fls/swf files for the whole thing. So difficult to explain much further. Thank you all :-)
Still Having Trouble With Navigation
i have five different slideshow pages(swfs/html pages)... each has a buttons(movie clips) that i would like to link to corresponding pages to pull up the new slideshow page into _self... unfortunately when i've tried getURL it doesn't seem to work... i've done it using absolute and relative paths... i'm sure it's something silly and little that i'm missing...
if anyone has any ideas it would be much appreciated...
thanks...
PLEASE HELP - Trouble With Navigation
I have a movie where the user will navigate through the movieclips using LEFT & RIGHT arrow keys. ENTER key will be the click. There will be no mouse. The trouble i am having is that i need the rollover state to show when the user goes over the movieclip. i found some code and it makes the movieclip transparent with alpha when it is selected. Instead of it being alpha, i need it to go to a rollover state. there would be a rollover state that would be inside the movieclip with a label ("over").
For example: button1.gotoAndStop("over") instead of button1._alpha=60;.
I have been trying to execute this but it is not working. I would appreciate it if someone can help me out with what i would need to do in order to make this work.
Actionscript CODE:
PHP Code:
// Declare variabled.
var btnOver:Number = 0; // The button that is currently highlighted.
var btnClicked:Number = 0; // The button that has been clicked.
// Mouse button codes.
button1.onRollOver = function() {
btnOver = 1;
highlighted();
}
button1.onRollOut = function() {
btnOver = 0;
highlighted();
}
button1.onRelease = function() {
btnClicked = 1;
selected();
}
button2.onRollOver = function() {
btnOver = 2;
highlighted();
}
button2.onRollOut = function() {
btnOver = 0;
highlighted();
}
button2.onRelease = function() {
btnClicked = 2;
selected();
}
button3.onRollOver = function() {
btnOver = 3;
highlighted();
}
button3.onRollOut = function() {
btnOver = 0;
highlighted();
}
button3.onRelease = function() {
btnClicked = 3;
selected();
}
button4.onRollOver = function() {
btnOver = 4;
highlighted();
}
button4.onRollOut = function() {
btnOver = 0;
highlighted();
}
button4.onRelease = function() {
btnClicked = 4;
selected();
}
// Create keyboard listener.
watchKeyboard = new Object();
watchKeyboard.onKeyDown = function() {
if (Key.isDown(Key.ENTER)) {
btnClicked = btnOver;
selected();
}
if (Key.isDown(Key.LEFT)) {
btnOver--;
if (btnOver < 1){
btnOver = 4;
}
highlighted();
}
if (Key.isDown(Key.RIGHT)) {
btnOver++;
if (btnOver > 4){
btnOver = 1;
}
highlighted();
}
}; // Close onKeyDown.
Key.addListener(watchKeyboard);
function highlighted(){
button1._alpha = 100;
button2._alpha = 100;
button3._alpha = 100;
button4._alpha = 100;
_root["button"+btnOver]._alpha = 60;
if (btnOver != 0) {
outputText = "Button " +btnOver+ " has been selected.";
}
else {
outputText = "";
}
};
function selected(){
_root["button"+btnClicked]._alpha = 100;
outputText = "Button " +btnClicked+ " has been clicked.";
};
PLEASE HELP!! THANK YOU!!!
Navigation Trouble
I have a movie where the user will navigate through the movieclips using LEFT & RIGHT arrow keys. ENTER key will be the click. There will be no mouse. The trouble i am having is that i need the rollover state to show when the user goes over the movieclip. i found some code and it makes the movieclip transparent with alpha when it is selected. Instead of it being alpha, i need it to go to a rollover state. there would be a rollover state that would be inside the movieclip with a label ("over").
For example: button1.gotoAndStop("over") instead of button1._alpha=60;.
I have been trying to execute this but it is not working. I would appreciate it if someone can help me out with what i would need to do in order to make this work.
Actionscript CODE:
PHP Code:
// Declare variabled.
var btnOver:Number = 0; // The button that is currently highlighted.
var btnClicked:Number = 0; // The button that has been clicked.
// Mouse button codes.
button1.onRollOver = function() {
btnOver = 1;
highlighted();
}
button1.onRollOut = function() {
btnOver = 0;
highlighted();
}
button1.onRelease = function() {
btnClicked = 1;
selected();
}
button2.onRollOver = function() {
btnOver = 2;
highlighted();
}
button2.onRollOut = function() {
btnOver = 0;
highlighted();
}
button2.onRelease = function() {
btnClicked = 2;
selected();
}
button3.onRollOver = function() {
btnOver = 3;
highlighted();
}
button3.onRollOut = function() {
btnOver = 0;
highlighted();
}
button3.onRelease = function() {
btnClicked = 3;
selected();
}
button4.onRollOver = function() {
btnOver = 4;
highlighted();
}
button4.onRollOut = function() {
btnOver = 0;
highlighted();
}
button4.onRelease = function() {
btnClicked = 4;
selected();
}
// Create keyboard listener.
watchKeyboard = new Object();
watchKeyboard.onKeyDown = function() {
if (Key.isDown(Key.ENTER)) {
btnClicked = btnOver;
selected();
}
if (Key.isDown(Key.LEFT)) {
btnOver--;
if (btnOver < 1){
btnOver = 4;
}
highlighted();
}
if (Key.isDown(Key.RIGHT)) {
btnOver++;
if (btnOver > 4){
btnOver = 1;
}
highlighted();
}
}; // Close onKeyDown.
Key.addListener(watchKeyboard);
function highlighted(){
button1._alpha = 100;
button2._alpha = 100;
button3._alpha = 100;
button4._alpha = 100;
_root["button"+btnOver]._alpha = 60;
if (btnOver != 0) {
outputText = "Button " +btnOver+ " has been selected.";
}
else {
outputText = "";
}
};
function selected(){
_root["button"+btnClicked]._alpha = 100;
outputText = "Button " +btnClicked+ " has been clicked.";
};
Navigation Trouble
As you will see in the code below, I added _self to try and open in the same window, but it just does not work.
Help??
Home_btn.buttonMode = true;
var link:URLRequest = new URLRequest("Index.html");
Home_btn.addEventListener(MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent):void {
navigateToURL(link, "_self");
}
Home_btn.buttonMode = true;
prev_btn.buttonMode = true;
var link2:URLRequest = new URLRequest("NDECEUpage3.html");
prev_btn.addEventListener(MouseEvent.CLICK, onClick2);
function onClick2(event:MouseEvent):void {
navigateToURL(link2, "_self");
}
prev_btn.buttonMode = true;
next_btn.buttonMode = true;
var link3:URLRequest = new URLRequest("NDECEUpage5.html");
next_btn.addEventListener(MouseEvent.CLICK, onClick3);
function onClick3(event:MouseEvent):void {
navigateToURL(link3, "_self");
}
next_btn.buttonMode = true;Text
Navigation Bar Trouble
hey everyone...been awhile since i needed a hand, but i'm stuck on trying to figure this out...though, it's probably a simple problem on my part...
anyway, my problem is this:
i want to create a navigation bar that follows the mouse on the y axis as the user moves around the screen.
once the user clicks a button, i want the navigation bar to quickly move up to y coordinate 57 and i want the navigation bar to be fixed to that spot from then on.
i've attached my fla. i have the following of the mouse working...but as far as getting the button to snap the navigation bar to the coordinate...shrug...
thanks in advance to anyone that can help
Navigation Tween Issues
As some of you guys may already know, my flash skills aren't exactly top notch and its come to the stage where Im having to ask for help again...
The images below show the concept for my websites navigation. The idea being that when you select say identity, they will all scroll up leaving identity in the centre with a blue tint.
Ive got that going and the tweens work fine when your going up or down the list in order but it skips when clicked out of order.
Im wondering if theres an easier way to do it than creating a different tween for each and every possible combination of mouse clicks..?
Im looking to get this put in to the site fairly soon (the rest is ready to roll you see) so I would really appreciate any help you could give...
Thanks in advance, stu
//ANYONE..?//
Tween Class Navigation?
Hi,
Can someone explain how this sort of navigation works: http://www.unit9.com/moon/
(you have to enter the site).
I see this sort of thing used a lot and I would like to implement a simple version of this. I am assuming it is using the tween class and moving a movie clip based on coordinates.
Can someone share similar code for this kind of solution.
Thanks,
ab
Navigation Help (Tween Class)
Would appreciate some help with the following code if possible, thanks!
// This is an array, a list of the buttons used.
var myButtons = [this.myButton_1, this.myButton_2, this.myButton_3, this.myButton_4];
// Loops on all buttons from the first to the last one
for (var i=0; i<myButtons.length; i++) {
// When the mouse rolls over this menu option... reduce size just a bit.
// NOTICE: I'm not taking into consideration the problem of having the hit area going down and "moving" the
// mouse area and out of the button (possible rollover flicking). This is just a simple example afterall.
myButtons[i].onRollOver = function() {
this.scaleTo(90, 0.5, "easeoutelastic");
};
In the above instance how would I address the problem of flickering? I think want to apply the .onRollOver to an invisible button instead. How can this be done??? Im just getting started with tweening animations outside the timeline with MCTween, would really appreciate some help/. Thanks.
Still Having Trouble W/ Basic Color Tween
ok.
i have flash mx
frame one i create a circele with one color
click on frame 10, cpress f6(to create an identical keyframe to frame one, right)
by doing this the new objest is highlighted so i go to the properties window and change the color....
next i click on any frame between 1 and 10 and creat a motion tween from insert menu..
it still does not work.
the motion tween is dotted ... i know its supposed to be a solid line.
if i click on tframe 10 and create tween it change the objects to the same color.... what in tarnations is goin on here?!
please help.
thank you
Tween Action Script Trouble
i need to make a tween in flash that repeats its self when it finishes. it needs to be 1 frame and be in action script 2.0 i have managed to make the tween but it wont play again.
Could any one give me and hand
Thanks
Stupid Saint
Simple Navigation Trouble
but it's driving me crazy.! Haven't fooled around with flash since flash 5 and now I am running MX 2004 Pro. I'm having simple navigation trouble.
I have MC on the main stage (MainMC) and inside MainMC I have a movie called skinTone so I can change the skintone of the model see LINK. Inside skinTone MC I have five labels "light, dark" etc... I cannot get th code to work. The button (change skintone) is located inside MainMC.
Please help it's driving me crazy.
I have tried
on (release) {
_root.MainMC.skinTone.gotoAndStop("light");
}
and about 5 others. what am I doing wrong? oh wonderful flash gurus. It's driving me nuts. *runs out of thread embarrassed
Navigation Trouble - Please, It's Urgent
hi there,
if anyone could help me with this problem i make sure i'll go to your country to give you a hug. I have a small site to present tomorrow, it's my last project in my final year at college. I have a "slide" navigation sistem, so, if i push a button, a movieclip inside a mask will move to a certain position. but the code that i used in a school exercise, moves an external movie clip, and not only another movie clip tha is inside of that one.
I have a movie clip called "turns", inside there are 2 movie clips inside masks called "turnoff" and "turnon". theres also a layer with this action script:
v=0;
_root.onEnterFrame = function() {
turnon._y=h-int(h-turnon._y)/1.2;
turnoff._y=h-int(h-turnoff._y)/1.2;
};
stop();
--------there is also the buttons with this code:
on (release) {
_root.turns.h = 200;
}
--------my teacher did this code, i changed the code in the actions layer so now the button moves both the turnoff and turnon movieclips. what i want is to have a button that moves "turnoff", and another that moves "turnon". i tryed different things but i cant make it work, i thought that changing the button code with "_root.turnoff.h = 200;", could work but no way.
I'm terrible in flash, i hope someone can help me. My site depends on this code. If you want i can send you the fla. file
thanks
Button Navigation Trouble
Hey everyone, I'm kinda new to all this flash stuff so I'd really appreciate your help on this...the thing is, I'm trying to make it so that after a button is pressed a certain number of times, it goes to a different scene. I have been searching for ways to do this for awhile, but I just can't seem to figure it out. I was thinking that an if statement might be useful for this but I'm not sure. If anyone could help me out, that would be great! Thanks so much in advance
Navigation Trouble - Should Be Simple
Help! I am trying to do a simple navigation task from a menu within a movie clip to a certain frame within another movieclip. Why can I not navigate to the point I need to go? What am I not seeing? This should be simple right?? The code I have tried is:
on (press) {
_root.Intro_Movie.gotoAndPlay("menu");
}
on (press) {
this._parent._parent._parent._parent.Intro_Movie.gotoAndPlay("menu");
}
on(release) {
with(_root.Intro_Movie) {
gotoAndPlay("menu");
}
}
Using The Tween Class For Menu Navigation
Good afternoon all and thank you for having me in your community. I appreciate it. I started using Flash back in college about 5 years ago. About a year after graduating I started to learn ActionScript 2.0 using O'Reilly's ActionScript 2.0: The Definitive Guide. However, because of my line of work I was unable to put much of this information to use and thus, I've lost a lot of it.
Now that I am building a website I am trying to create a navigation without the use of a timeline so that the navigation stays dynamic.
The premise of the site is a portfolio. It is in the image of an office lounge with three specific sections for Photo/Retouching, Web, and Collateral pieces each in their own area of the lounge (i.e. an Easel, a desk and a computer monitor). Before I had the file set up with timelines and when using the navigation bar each button would use a gotoAndPlay() to the appropriate frames and play the timeline animation. As you can imagine it was pretty linear.
I would like to be able to use AS to scale, set transparency, etc. the objects in the scene dynamically so that no matter where you go or where you are coming from in the scene it is smooth and non-linear.
example:
you click on the desk (or the corresponding menu item) and everything in the scene scales up and the stage focuses on the desk and the other pieces fade from the scene.
you click on the screen and the desk fades and the focus goes to the screen, etc.
I know this is a long first thread. However, I will include a modified screenshot to help anyone willing to give me a few pointers. I've checked out some tutorials on the Tween class using the easeInOut and whatnot and I believe that this is the direction I want to go in, but I do not understand the basic setup of classes at the moment. Can I just use the coordinates and the scale in the Flash Properties to say "Desk: go from this size and coord. to this size and coord."?
Tween Class Trouble (based On The Tutorial)
Hey hey hey.
I was gonna have a fiddle with this tutorial http://www.kirupa.com/developer/actionscript/tween.htm
so I downloaded, unzipped, saved and published it. I didn't have a chance to fiddle with anything and it's already broken! I get this:
**Error** Scene=Scene 1, layer=actions, frame=1:Line 5: There is no property with the name 'onMotionFinished'.
xScaleT.onMotionFinished = function() {
**Error** Scene=Scene 1, layer=actions, frame=1:Line 8: There is no property with the name 'onMotionFinished'.
xPosT.onMotionFinished = function() {
Total ActionScript Errors: 2 Reported Errors: 2
Any ideas why guys? Cheers in advance.
<"))))><
Edit: MX04 by the way.
Simple NEXT-style Navigation Trouble
here's the deal, (am I stoopid or what?)(dont answer that)
I have on stage, a button and a movie clip with an instance name of "joe". Within that movie clip is a ball and various frames with stop actions on them. The ball is in a different location at each stop frame. I want to simulate movement of a ball around a circle (they are motion tweened.)
Can't I just put a script on the button on main timeline telling the movie clip to go to the current frame + 1, to make the movie incrementally move ahead?
on (press) {
_root.joe.gotoAndPlay(_currentframe+1);
}
this is my code on the button. It keep looping back to frame 1 and never getting beyond the first tween. What am I missing?
Trouble With Navigation Betweet Layers
hi
i want to make someting.... i just follow the tutorials but it dont work..... maby i forget someting? can somebody help me out? flash 5
on scene 1 there is a stop commant.
in scene 1 there are 2 movie's movie "first" and movie "second"
there is only one layer in scene 1
on movie "first" there is a stop commant in de first frame.
in movie "first" there is a button "button"
on movie "second" there are stop commants on the first en second frame.
there is a grapic on frame 1 a other on frame 2.
This is what i will make.
when you click on the button in movie "first" movie "second" must go to second frame....
This is action script on the button now:
on (release) {
_root.second.gotoAndStop(2);
}
when i start this no failure is reported but the button don't do anyting............
can somebody help me out?
thanks
[f8] Side-Scrolling Navigation Trouble
What i'm trying to do is create a flash navigation that has a sub menu that scrolls sideways. I want it to be automatic, so depending on where the mouse is over the sub nav, it reveals that area of the sub nav.
OBJECTIVES:
- I need help with my AS math to get flash_navigator_ver2.fla to ease the sub nav to reveal the nav depending on where the mouse is
- The movement should only happen on mouseover of the sub button
- the sub nav should ease but NOT should not slide past farther than the end of the current button.
I hope this makes sense. If so, is this even possible? I have detailed notes below in case you feel up to the challenge.
thanks,
jwt
Please view the enclosed files. flash_navigator_ver1.fla was the first working version i had. I thought it was working properly, EXCEPT i was finding that the sub nav would move position before you got a chance to hit some of the buttons. (test and try to hit every button, you'll see what i mean). Also, it uses a continuous loop to detect the position of the mouse -- not very processor friendly.
flash_navigator_ver2.fla is the new version. What i had done was remove the looping statement and instead called the reposition function only when the user moused over a sub button. adjustScrollerNew(myWidth, myX)
Now i assume you will need to get the position and width of the sub button so you can make sure the scroll doesn't go past the edge of the button. I want the sub nav to ease only once upon rolling over the button.
All the script for the subnav is in the root layer called "FUNCTION SUB"
Navigation should target Flash 7
Scope Trouble... Unregister/ Remove Object / Tween ?
Hi,
I hope somebody can help with the following problem.
I'm trying to make a powerpoint kind of projector:
- Main flash movie: works as a container to load different flash files.
reacts on the left and right arrow buttons to go to the next or previous movie, which is loaded in a movieClip.
- Several external swf files all exported from the same: slide.fla only adjusting xml node settings make the differences in text and pictures.
This works, but after loading into the container I use to show the images the tween of my images gets messed up. (Not in the first loaded movie, but sure after around the third)
Please can anybody look at my code and tell me what could be the problem?
I'm sure it has to do with the scope after loading into the container.fla, and all the objects having the same name, for the submovies. (exported from the same .fla)
Do I have to unregister/ remove these objects after usage - I think this might be it, but don't know how.
In the container.fla I already set:
clipLoader_mc._lockroot = true;
but this doesn't solve the problem.
Code:
/// **************************** ///
/// START TWEEN METHODS FOR SCREENS ///
/// **************************** ///
var mcl_obj:Object = new Object();
mcl_obj.onLoadInit = function(target_mc:MovieClip):Void {
target_mc._width = 500;
target_mc._height = 395;
target_mc._x = 500;
var distance:Number = 5;
var angleInDegrees:Number = 45;
var color:Number = 0x000000;
var alpha:Number = 75;
var blurX:Number = 7;
var blurY:Number = 7;
var strength:Number = 1;
var quality:Number = 3;
var inner:Boolean = false;
var knockout:Boolean = false;
var hideObject:Boolean = false;
var filter:DropShadowFilter = new DropShadowFilter(distance, angleInDegrees, color, alpha, blurX, blurY, strength, quality, inner, knockout, hideObject);
var filterArray:Array = new Array();
filterArray.push(filter);
target_mc.filters = filterArray;
var tween_target:Object = new Tween(target_mc, "_y", Back.easeInOut, Stage.height, 300, 1, true);
tween_target.onMotionFinished = function() {
intervalClearScreenId = setInterval(ClearScreen, 8000, counter);
};
screenCounter++;
//initiated on top of the page.
};
function ClearScreen():Void {
var tween_screen:Object = new Tween(mover_mc, "_x", Strong.easeInOut, mover_mc._x, 1250, 1, true);
tween_screen.onMotionFinished = function() {
if (screenCounter<screenMaxCount) {
ShowScreens();
} else {
screenCounter = 0;
ShowScreens();
}
clearInterval(intervalClearScreenId);
};
}
ShowScreens = function ():Void {
// Create a movie clip instance.
this.createEmptyMovieClip("mover_mc", getNextHighestDepth());
var img_mcl:MovieClipLoader = new MovieClipLoader();
img_mcl.addListener(mcl_obj);
// Load an image into the movie clip
img_mcl.loadClip(imageArray[screenCounter], mover_mc);
};
//load XML voor screens on the left:
function loadScreensXML(loaded) {
if (loaded) {
_rootNode = this.firstChild.childNodes[imageNodeNr].childNodes[0];
trace(_rootNode);
total = _rootNode.childNodes.length;
for (i=0; i<total; i++) {
//add images to imageArray:
imageArray[i] = _rootNode.childNodes[i].firstChild.nodeValue;
}
screenMaxCount = imageArray.length;
//initiated on top of the page
//Show the screens:
ShowScreens();
} else {
content = "file not loaded!";
}
}
xmlScreens = new XML();
xmlScreens.ignoreWhite = true;
xmlScreens.onLoad = loadScreensXML;
xmlScreens.load(urlImagesXML);
/// **************************** ///
/// END TWEEN METHODS FOR SCREENS ///
/// **************************** ///
I'm trying all day already to solve this so please can anybody help?
Thanks in advance!
Trouble With Functions And Navigation...oh The Pain...ohh The Agony...
Hey there,
I am new with ActionScript, but not new to flash. A friend told me that it is more efficient to place my actionscript in functions on frame one of the main timeline rather than having it all appear throughout the page on various buttons etc. I am trying to get a button tht loads in the main timeline to call upon a function, and then have it perform the following actions:
a) When the mouse is released, it will send the information to a function called openServices. The code to send it here is
//Services Button - loads the services swf
on(release){
_root.openServices();
}
Then the fuction code I have is as follows,
//Services Button - loads the services SWF file into the main time line.
fuction openServices(services_btn) {
_root.createEmptyMovieClip ("infoPage_mc",_root.getNextHighestDepth());
_root.infoPage_mc.loadMovie("hello.swf");
_root.infoPage_mc._y=55;
_root.infoPage_mc._x=0;
}
The button's instance is services_btn .
When I try to test the movie, it states that I have a syntax error. Forgive my inability to detect this error, but I would more than appreciate some assistance. I love the idea of functions, and hope to make use of them more if I can just see a good model of one.
Later, and Thanks,
Greg
RemoveChild - Trouble Removing Sprite W/ Tabbed Navigation
I have a widget I've created. It's composed of:Shell.as - document class, from which I loadBackground.as (extends Sprite) - loads background assets for widget
Navigation.as (extends Sprite) - the tabbed navigation object for the widget
GameDayTab.as, TeamInfoTab.as or NewsTab.as (each extends Sprite) - one of these at a time; the content for each section called from the tabbed navigation
Right now, I instantiate one of each of the three tab classes depending on user interaction. When I flip between the tabs in the widget, I make the other 2 invisible to the user:
ActionScript Code:
// load tab content
private function loadTab(current_tab:String, last_tab:String = null):void
{
trace(":: loadTab() ::");
if (last_tab)
{
switch(last_tab)
{
case "nav_tab_0" :
if(_gameDayTab) { _gameDayTab.visible = false; }
break;
case "nav_tab_1" :
if(_teamInfoTab) { _teamInfoTab.visible = false; }
break;
case "nav_tab_2" :
if(_newsTab) { _newsTab.visible = false }
break;
}
}
switch(current_tab)
{
case "nav_tab_0" :
if (_gameDayTab)
{
_gameDayTab.visible = true;
}
else
{
_gameDayTab = new GameDayTab(_configData.game_day_tab_xml, _cssStyles);
_gameDayTab.name = "game_day_tab";
addChild(_gameDayTab);
}
break;
case "nav_tab_1" :
if (_teamInfoTab)
{
_teamInfoTab.visible = true;
}
else
{
_teamInfoTab = new TeamInfoTab(_configData.team_info_tab_xml, _cssStyles);
_teamInfoTab.name = "team_info_tab";
addChild(_teamInfoTab);
}
break;
case "nav_tab_2" :
if (_newsTab)
{
_newsTab.visible = true;
}
else
{
_newsTab = new NewsTab(_configData.news_tab_xml, _cssStyles);
_newsTab.name = "news_tab";
addChild(_newsTab);
}
break;
}
}
This is soooo rudimentary to me. What I would LIKE to do is to REMOVE a current tab instance entirely (deleting all data associated with it) so that, when a user revisits the tab, the tab content refreshes (loads updated XML information -- each tab does this in various ways).
Problem is, when I tried to remove GameDayTab.as instance, which included a few calls to the BulkLoader class, I got errors from BulkLoader saying that it had already been instantiated. I couldn't do this:
ActionScript Code:
removeChild(_gameDayTab)
and then run the load function again for that tab type.
What is the best way to manage sort of content windows like this with removeChild?
Thanks,
IronChefMorimoto
Loaded Navigation Menu Via MovieClipLoader But When Tween Is Applied, Links Cannot.
I have been at it for the past two days and cannot seem to get this going, I would highly appreciate your help with this. I have movie called "menus.swf" within it, I have four nav buttons: LINK 1, LINK 2, LINK 3, LINK4.
I load this movie via MovieClipLoader on to the stage and initialize it via onLoadInit. Once it is loaded, I am able to click the links and all works well. I want to be able to use dynamic mask and show only the top part of the loaded movie so when user rolls the mouse over it, it pops up with ease and use can then click the desired link, and as soon as the mouse is not over it, movie eases back into its original position. I have tried tons of strategies such:
hitTest(), time driven event.....and so on.
I am able to load the movie without any issue but once I place an ease tween on it, Tween works but an not able to click on any nav links. I have spent hours and hours but cannot seem to get this functionality going. I would highly appreciate all your help. I am also including my files as well.
Code: ....
Laco Tween Engine Versus Flash Native Tween
i am wondering if there is a way to put a delay (seconds) on the flashs' native tween class like you can on the laco tween engine... such as
Code:
#include "lmc_tween.as"
my_mc.tween("_x",100,1,"easeOutStrong",1.5,callbackFunction)
where "1.5" is would be the one and a half second delay before the tween starts. this is very useful to me because i dont have to use a callback function or an onMotionFinished function to start a new tween.
thanks in advance to anyone who can teach me
-frankf
Navigation Trouble, Using Button Rollover, Rollout And Button Down
Hello all
Take a look at the following sites; and notice their menus. Both have a rollover and rollout on their buttons, and when the button is hit the button stays down until another button is pressed. In the scissor sisters site, the neon bar still fades out after another has been pressed.
Franz Ferdinand
Scissor Sisters
I am trying to achieve this myself with my own site, which you can view in progess here:
My Site
I have mastered the button rollOver and rollOut effect, in which i gathered the code from a kirupa tutorial. My problem is, getting the neon bar to stay underneath teh last button that has been pressed.
The main movie is located on the main timeline in frame 2, because frame 1 contains the pre loader.
The actions for frame 2 of the main timeline are:
Code:
stop();
movieLoader.loadMovie("news.swf");
total = movieLoader.getBytesTotal();
loads = movieLoader.getBytesLoaded();
percent1 = Math.round(loads/total*100);
movieLoadText.text = "Loading news "+percent1+"%";
if (loads != total) {
} else {
movieLoadText._visible = false;
}
Now the buttons are not buttons, they are movieclips, which are located on the stage, and have instance names of b1 for news, b2 for biography etc etc
Inside the movieclip, the animation of the neon bar fading in takes 25 frames, and this has a stop action on the end.
This code is placed on the first frame:
Code:
stop();
news.onEnterFrame = function(){
if(rewind == true)
{
prevFrame();
}
}
news.onRollOver = function(){
rewind = false;
gotoAndPlay(25);
}
news.onRollOut = function(){
rewind = true;
}
news.onRelease = function(){
_root.logo.gotoAndPlay("buzz");
_root.movieLoader.loadMovie("news.swf");
}
As you have probably noticed this is the same as the kirupa tutorial.
So now my problem is to make sure that the last button clicked leaves the underline bar down until the next button is pressed.
Whoever can solve this for me is a life saviour!
Thanks
Williby
[CS3]{as2} Dynamic Navigation, Dynamic Tween.
Hi all,
What I'm looking to do is after you push a button the color of the background will fade/tween to a different color.
As you might allready have figured out this is not possible with with a normal linear shape tween, because what color the background will fade to, depends on what button you push.
An alternative is of course to make tweens of all the possible outcomes and change the buttons after which background you are currently on, but there HAS to be an easier way than that? And i guess that method will give me a giant .swf.
Hope there is somebody out there with the skills to give me an answer.
Thanks!
Tween Class: Can One Tween More Than One Property Using The Same Tween
I want to scale both the _xscale and the _yscale properties of a clip, using a single execution of the Tween Class. See example below:
Code:
import mx.transitions.Tween;
var myTween:Tween = new Tween(myMovieClip_mc, "_xscale", Strong.easeOut, myMovieClip_mc._xscale, 300, 5, false);
Since one property at a time must be passed as a string to the constructor, I tried the following code, but it does not work quite as flawless as I expected:
Code:
myTween.onMotionChanged = function() {
//trace( this.position );
myMovieClip_mc._yscale += (300 - myMovieClip_mc._yscale)/12;
};
Any suggestions?
Using Stop(); On A Shape Tween Of A Swapped Movie Clip Symbol Within A Motion Tween
Thanks a lot for your time. I'm new to actionscript, and language syntax and I never really got along to begin with so I appreciate any help in the matter.
Basically the title says it all - I made a motion tween in the main scene, made a movie clip symbol (to shape tween a gradient) and added a stop(); inside the gradient-tweened-symbol. I then swapped the movie clip symbol with the motion tween in the main scene, and got exactly the effect I wanted (the item moved, then tweened itself) but the stop(); seems to have no effect.
I know this looks like one of those "that idiot didn't google before posting" questions, but I've been looking for about a half hour with different permutations of stop, doesn't work, actionscript, and flash, and I haven't found anything that seems to target this problem specifically.
If you've got any idea what's going wrong, please feel free to respond or show me how to better seek help on my own. Thanks again.
Tween Class If Moved Mc Passed Point Start Another Tween
Hey Actionscript Gurus
Now I am using the Tween Class to move some boxes in my movie, now I can move the first mc and then another mc after the first tween has finished with onMotionFinished but I was hoping someone could help with how do I start the second tween when the first mc has passed a certain _x coordinate.
ie starting the second mc moving while the first tween is still moving.
I am trying to do a intro loader for my front page controlling around 7 boxes. So I need to repeat this a few times.
Regs,
Jacko
Tween Class If Moved Mc Passed Point Start Another Tween
Hey Kirupa Flash Gurus
Now I am using the Tween Class to move some boxes in my movie, now I can move the first mc and then another mc after the first tween has finished with onMotionFinished but I was hoping someone could help with how do I start the second tween when the first mc has passed a certain _x coordinate.
ie starting the second mc moving while the first tween is still moving.
Regs,
Jacko
Tween Class Scaling Breaks Motion Tween?
I have a movie clip which uses a motion guide to animate the entry (and eventually the exit) of a bunch of other movie clips. These smaller clips contain buttons, and animate on rollOver and rollOut using the following code:
Code:
on(rollOver) {
this.swapDepths(2);
ParentxScale = new mx.transitions.Tween(this, "_xscale", mx.transitions.easing.Back.easeOut, this._xscale, 100/.6, .5, true);
ParentyScale = new mx.transitions.Tween(this, "_yscale", mx.transitions.easing.Back.easeOut, this._yscale, 100/.6, .5, true);
play();
}
on(rollOut) {
ParentxScale = new mx.transitions.Tween(this, "_xscale", mx.transitions.easing.Bounce.easeOut, this._xscale, 100, .5, true);
ParentyScale = new mx.transitions.Tween(this, "_yscale", mx.transitions.easing.Bounce.easeOut, this._yscale, 100, .5, true);
stop();
}
However, once an object has been moused over, it doesn't exit with the others. Any ideas why it seems to "fall off the track" of the motion guide?
|