[AS2] Tweener Button Help
HiI'm using Tweener to create rollovers (changing the text colour) with the attached code.The rollover works great, but I want the button/text to remain in the rollover colour of red (990000) when the button is pressed, but can't seam to get it working. I have tried added the last tweener command into a onPress function as well with no luck.Has anyone any pointers??ThanksAttach CodemovMenuBar.movServicesBtn.onRollOver = function() { Tweener.addTween(movMenuBar.movServicesBtn.txtServices, {_text_color:0x990000, time:2});};movMenuBar.movServicesBtn.onRollOut = function() { Tweener.addTween(movMenuBar.movServicesBtn.txtServices, {_text_color:0x999999, time:2});};movMenuBar.movServicesBtn.onRelease = function() {Tweener.addTween(movMainContent, {_x:0, time:1.5, transition:"easeInOutBack"});movMainContent.movServices.gotoAndPlay("services_start"); Tweener.addTween(movMenuBar.movServicesBtn.txtServices, {_text_color:0x990000});};
Adobe > ActionScript 1 and 2
Posted on: 12/14/2008 12:29:16 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
[CS3] [AS2] Tweener Button Help
Hi
I'm using Tweener to create rollovers (changing the text colour) with the following text;
Code:
movMenuBar.movServicesBtn.onRollOver = function() {
Tweener.addTween(movMenuBar.movServicesBtn.txtServices, {_text_color:0x990000, time:2});
};
movMenuBar.movServicesBtn.onRollOut = function() {
Tweener.addTween(movMenuBar.movServicesBtn.txtServices, {_text_color:0x999999, time:2});
};
movMenuBar.movServicesBtn.onRelease = function() {
Tweener.addTween(movMainContent, {_x:0, time:1.5, transition:"easeInOutBack"});
movMainContent.movServices.gotoAndPlay("services_start");
Tweener.addTween(movMenuBar.movServicesBtn.txtServices, {_text_color:0x990000});
};
The rollover works great, but I want the button/text to remain in the rollover colour of red (990000) when the button is pressed, but can't seam to get it working. I have tried added the last tweener command into a onPress function as well with no luck.
Has anyone any pointers??
Thanks
Help With Tweener Button
Hello,
I've used this code in AS2 and want it for a multiple buttons. I want once the movie clip is pressed to (do the below) but it does not seem to work. how do I get movie clip to go a specific frame label? The movie clip code is shown in the second part. The code inside the movieclip.
on (press)
{
gotoAndplay ("one");
}
------------------------------
I'm using this code for the scale tween on the movie clip
import mx.transitions.Tween;
import flash.geom.ColorTransform;
import flash.geom.Transform;
var myTween:Tween = new Tween(scale_mc1, "_xscale", mx.transitions.easing.Elastic.easeOut, 100, 200, 1, true);
var myTween1:Tween = new Tween(scale_mc1, "_yscale", mx.transitions.easing.Elastic.easeOut, 100, 200, 1, true);
var myTween2:Tween = new Tween(scale_mc1, "_xscale", mx.transitions.easing.Elastic.easeOut, 200, 100, 1, true);
var myTween3:Tween = new Tween(scale_mc1, "_yscale", mx.transitions.easing.Elastic.easeOut, 200, 100, 1, true);
scale_mc1.onRollOver = function():Void {
myTween.start();
myTween1.start();
};
scale_mc1.onRollOut = function():Void {
myTween2.start();
myTween3.start();
};
Tweener Button Help
Hi
I'm using Tweener to create rollovers (changing the text colour) with the following text;
Code:
movMenuBar.movServicesBtn.onRollOver = function() {
Tweener.addTween(movMenuBar.movServicesBtn.txtServices, {_text_color:0x990000, time:2});
};
movMenuBar.movServicesBtn.onRollOut = function() {
Tweener.addTween(movMenuBar.movServicesBtn.txtServices, {_text_color:0x999999, time:2});
};
movMenuBar.movServicesBtn.onRelease = function() {
Tweener.addTween(movMainContent, {_x:0, time:1.5, transition:"easeInOutBack"});
movMainContent.movServices.gotoAndPlay("services_start");
Tweener.addTween(movMenuBar.movServicesBtn.txtServices, {_text_color:0x990000});
};
The rollover works great, but I want the button/text to remain in the rollover colour of red (990000) when the button is pressed, but can't seam to get it working. I have tried added the last tweener command into a onPress function as well with no luck.
Has anyone any pointers??
Thanks
Tweener (caurina.transitions.Tweener) In AS3
I dont know If it has been mentioned before but there' s a new version available for download that can be used for be used on AS3 projects targeting Flash Player 9 and above! Check it here: http://code.google.com/p/tweener/
Active State To AS2 Button Class (w/Tweener)
Been trying to get my head round this for the past 2days but can't get it to work/
Basically I need to create an active state to a custom button class. I know I need to set a variable to hold the active state onRelease within the class. And also know I need to for loop through all the buttons to de-active any that were previously selected. Think the for loop will go in the main timeline but not sure how to change the states of my button class from the main timeline.
At the mo i'm using Tweeners example here:
http://tweener.googlecode.com/svn/tr...as2_flash8.zip
as a base. Could anyone help with the code to do this? Unfortunatley no forum there!
Are Too Many Tweener's Bad?
I have a animation which runs on around 30 Tweeners, it runs fine on my mac but judders on a pc?
What alternative do I have?
Help With Tweener
im basicly want to control what color the text goes instead of going the same color of the movie clip, if any 1 could help id be grateful
heres the code and i have attached the fla and swf
import caurina.transitions.Tweener;
var out : Object = {
_x:70,
time:1,
transition: "bounceeaseIn"
}
var textcolor : Object = {
_color:0xffffff,
time:1,
transition: "bounceeaseIn"
}
var scale : Object = {
_x:80,
_xscale:110,
_color:0x000000,
time:1,
transition: "bounceeaseIn"
}
var myButtons:Array = new Array("home","services","contactus");
var arrayLength:Number = myButtons.length;
var startY:Number = 23;
var startX:Number = 40;
for (var i = 0; i<arrayLength; i++) {
but = this.attachMovie("button", "button"+i,i, {_x:30+(startX), _y:40 +(startY*i)});
but.text1.text = myButtons[i];
but.onRollOver = function() {
Tweener.addTween(this,{base:scale});
};
but.onRollOut = function() {
Tweener.addTween(this,{base:out});
};
}
AS3 And Tweener
I am relatively new to working in AS3 and Tweener, and I am having trouble making onComplete and delay functions work within Tweener when calling them from an Enter_Frame event. Example
line_mc.addEventListener(Event.ENTER_FRAME, intro);
function intro(event:Event):void
{
Tweener.addTween(event.target, {alpha:1, time:.2, delay:2, transition:"easeOutQuad", onComplete:lineOut});
}
function lineOut():void
{
line_mc.alpha = 0;
}
AS3 And Tweener
Does somebody knows how to cancel an active Tweener command? for example if I roll over a button with this action.
Tweener.addTween(step2, {alpha:1,delay:0.9,time:0.5,transition:"easeInOutS ine"});
And suddenly I roll over step3 for example.
Tweener.addTween(step3, {alpha:1,delay:0.9,time:0.5,transition:"easeInOutS ine"});
Sometimes it executes the code above showing both steps at the same time. I tried using both ROLL_OVER and MOUSE_OVER on the event listener but if I go over one fast and back it displays both.
Seems like the ROLL_OUT making step2.alpha = 0; is not be working right. Is there a code to cancel that tweener command when I roll over the next one?
[CS3] Tweener Code Help
Hello,
I got this code which works really well (below), when one movie clip is on the stage. Now I want multiple movies/buttons and the other buttons don't seem to work. What do I need to do?
I've changed the instance name to "scale_mc1" but not sure where to put it.
Rather than having the code in the timeline, should I put it on the symbol itself?
thanks
----------------------------
import mx.transitions.Tween;
import flash.geom.ColorTransform;
import flash.geom.Transform;
var myTween:Tween = new Tween(scale_mc, "_xscale", mx.transitions.easing.Elastic.easeOut, 100, 200, 1, true);
var myTween1:Tween = new Tween(scale_mc, "_yscale", mx.transitions.easing.Elastic.easeOut, 100, 200, 1, true);
var myTween2:Tween = new Tween(scale_mc, "_xscale", mx.transitions.easing.Elastic.easeOut, 200, 100, 1, true);
var myTween3:Tween = new Tween(scale_mc, "_yscale", mx.transitions.easing.Elastic.easeOut, 200, 100, 1, true);
scale_mc.onRollOver = function():Void {
myTween.start();
myTween1.start();
};
scale_mc.onRollOut = function():Void {
myTween2.start();
myTween3.start();
};
import mx.transitions.Tween;
import flash.geom.ColorTransform;
import flash.geom.Transform;
var myTween:Tween = new Tween(scale_mc, "_xscale", mx.transitions.easing.Elastic.easeOut, 100, 200, 1, true);
var myTween1:Tween = new Tween(scale_mc, "_yscale", mx.transitions.easing.Elastic.easeOut, 100, 200, 1, true);
var myTween2:Tween = new Tween(scale_mc, "_xscale", mx.transitions.easing.Elastic.easeOut, 200, 100, 1, true);
var myTween3:Tween = new Tween(scale_mc, "_yscale", mx.transitions.easing.Elastic.easeOut, 200, 100, 1, true);
scale_mc.onRollOver = function():Void {
myTween.start();
myTween1.start();
};
scale_mc.onRollOut = function():Void {
myTween2.start();
myTween3.start();
};
Tweener Transition?
Im using tweener and I want my MC to move up and then left, but the following code makes it go diagonal:
Code:
Tweener.addTween(content1, { y:500, time:3, transition:"easeoutbounce"});
Tweener.addTween(content1, { x:500, time:3, transition:"easeoutbounce"});
What code do I need to make it to go up then left?
[CS3] Tweener Classs?
How do I down load tweener code off google and put it into Flash so I can always import the class into my actionscript?
Tweener Problem
Hi
I'm having a problem with Tweener, I want it so that after myMC has tweened across the screen, it runs the function test, but unfortunately test runs before the tween has finished, what is the way around this?
Tweener.addTween(myMC, { x:100, time:time, transition:trans, onComplete:test()});
Singleton Tweener?
I've developed a rather groovy app which creates objects on the stage according to the server vars passed to it. Each of these objects has the ability to move and at the moment I am using a home-grown tweener class but I'm just wondering whether to use it as a singleton or to create new instances of this class for each object.
I can see one obvious bonus or maybe even hinderance depending on the app but this tweener class is also a broadcaster and as such can dispatch events back to the objects being tweened.
The main question really is, is it better to have one instance running many tweens or many instances running fewer tweens?
Tweener Class
Ok everyone and there mom says this class is so great but I'm pulling my hair out just to get it to import right. Maybe its not great and everyone else is on crack, or I'm missing something.
I imported caurina to my nav class which is imported to my main AS file.
I put this in:
Code:
import com.caurina.transitions.*;
as that is where i have the file located and I have my flash AS 3.0 set to look in that main folder for classes.
I then put this in:
Code:
private function moveBtn1():void {
Tweener.addTween(btn1_mc, {_alpha:100, time:1});
}
The result are these errors:
Code:
1046: Type was not found or was not a compile-time constant: TweenListObj.
1180: Call to a possibly undefined method PropertyInfoObj.
1180: Call to a possibly undefined method TweenListObj.
and BUNCHES more, its so gay, what do I do???
HELP!!
Using Tweener For Loops
Anyone know how to get Google's awesome Tweener class to animate loops, similar to that of a MovieClip with it's own timeline? Things like alpha fading in out and forever or filter controls would be awesome. Is this possible?
[Tweener] Error
I am trying to take an animation made in flash and make a rollover event in flash for my website. Im getting this error:
## [Tweener] Error: The property '_frame' doesn't seem to be a normal object property of [object paintings_1] or a registered special property.
Here is the script:
import caurina.transitions.*;
butt.addEventListener(MouseEvent.ROLL_OVER,butt_RO LLOVER);
function butt_ROLLOVER(e:MouseEvent):void {
Tweener.addTween(paintings,{_frame:17,time:0.5,tra nsition:"linear"});
}
What do you think?
Tweener N00b
hey can someone help with this.. im trying to store a Tweener animation in a variable like this...
var mycamtween:Tweener.addTween(camera, {zoom: 4, time: 1} );
however this doesnt work i get...
1046: Type was not found or was not a compile-time constant: .
how can i get this to work? cheers.
Tweener Problem
Ok, so I followed this tutorial at www.gotoandlearn.com,
but since it's down since a while i'll be asking my question here.
I did a tutorial where you import a .flv which starts playing when rolling over a button. The .flv is controlled by caurina's class Tweener.
So I followed the tutorial completely, everything seems to work fine, but when I'm trying to play the .swf it gives me this error:
Code:
## [Tweener] Error: The property '_frame' doesn't seem to be a normal object property of [object ticket_1] or a registered special property.
This is the AS used:
ActionScript Code:
import caurina.transitions.*; // import caurina's class
//but = the button that has to be clicked on
but.addEventListener(MouseEvent.ROLL_OVER , but_ROLLOVER);
function but_ROLLOVER(e:MouseEvent):void
{
Tweener.addTween(ticket, {_frame:18, time:0.5, transition:"Linear"});//play movie called ticket in 0.5 seconds
}
but.addEventListener(MouseEvent.ROLL_OUT , but_ROLLOUT);
function but_ROLLOUT(e:MouseEvent):void
{
Tweener.addTween(ticket, {_frame:0, time:0.5, transition:"Linear"}); //fade out movie called ticket in 0.5 sec.
}
So is anyone that knows what's causing this problem or what I could do to solve this?
(the error is there whenever the button is rolled over)
EDIT:
I found out that the problem is cause by the _frame:0, so what should i replace it with ?
Caurina Tweener
How do i use caurina to move an object 50px up. something like
ActionScript Code:
Tweener.addTween(e.currentTarget, {y:+50});
Looping Tweener?
Hi,
I've got a movieclip(button) which scrolls a movieclip(content) within a masked area, the idea is that when the button is rolled over, the content scrolls up. I'm not sure how to implement this in AS3, but in AS2 you could use the onEnterFrame function, but i'm sure there is a more efficient way, and i'm wondering whether it is possible with Tweener...
ActionScript Code:
movContentContainer.mcBlogBox.mcOldNews.addEventListener(MouseEvent.ROLL_OVER, showOldNews, false, 0, true);
private function showOldNews(evt:MouseEvent):void {
keepScrolling();
}
private function keepScrolling():void {
var tempYPosition:Number = movContentContainer.mcBlogBox.mcBlogEntriesContainer.y;
Tweener.addTween(movContentContainer.mcBlogBox.mcBlogEntriesContainer, {time:1, y:tempYPosition -= 100, transition:"easeOutQuart"});
trace(tempYPosition);
}
At the moment, the scrolling is not smooth, doesn't seem to be obeying the parameters and also for some reason the "MouseEvent.ROLL_OVER" only works once, and you have to rollover the button each time, nevertheless still jerky.
EDIT: ignore the smoothing parts - that's resolved...
now im wondering why it does not continually scroll when the mouse is over the button.
Papervision, Tweener Help
Hi, I have a problem that i'm confused by:
I have a simple plane called grassPlane, and in actions I've wrote down:
Tweener.addTween(grassPlane, {x:700, time:8});
This works all fine and dandy by itself, but I want it so that when I click the plane it carries out that action. I've now got:
grassPlane.addEventListener(MouseEvent.CLICK,butto nPressed);
function buttonPressed(e:MouseEvent) {
Tweener.addTween(grassPlane, {x:700, time:8});
}
but this doesn't work, so what have I done wrong? Give us some help please
Tweener Error
I am trying to use the tweener class in mx2004. I have used it on other PCs without a problem but for some reason flash just keeps giving this error:
ActionScript Code:
**Error** C:Documents and SettingscrossbrandDesktopactionscriptcaurina ransitionsTweener.as: There is no property with the name 'e'.
**Error** C:Documents and SettingscrossbrandDesktopactionscriptcaurina ransitionsTweener.as: Line 338: There is no property with the name 'e'.
handleError(_tweenList[i], e, "onOverwrite");
**Error** C:Documents and SettingscrossbrandDesktopactionscriptcaurina ransitionsTweener.as: There is no property with the name 'e'.
**Error** C:Documents and SettingscrossbrandDesktopactionscriptcaurina ransitionsTweener.as: Line 670: There is no property with the name 'e'.
handleError(tTweening, e, "onUpdate");
**Error** C:Documents and SettingscrossbrandDesktopactionscriptcaurina ransitionsTweener.as: There is no property with the name 'e'.
**Error** C:Documents and SettingscrossbrandDesktopactionscriptcaurina ransitionsTweener.as: Line 699: There is no property with the name 'e'.
handleError(tTweening, e, "onStart");
**Error** C:Documents and SettingscrossbrandDesktopactionscriptcaurina ransitionsTweener.as: There is no property with the name 'e'.
**Error** C:Documents and SettingscrossbrandDesktopactionscriptcaurina ransitionsTweener.as: Line 744: There is no property with the name 'e'.
handleError(tTweening, e, "onUpdate");
**Error** C:Documents and SettingscrossbrandDesktopactionscriptcaurina ransitionsTweener.as: There is no property with the name 'e'.
**Error** C:Documents and SettingscrossbrandDesktopactionscriptcaurina ransitionsTweener.as: Line 756: There is no property with the name 'e'.
handleError(tTweening, e, "onComplete");
**Error** C:Documents and SettingscrossbrandDesktopactionscriptcaurina ransitionsTweener.as: There is no property with the name 'metaError'.
**Error** C:Documents and SettingscrossbrandDesktopactionscriptcaurina ransitionsTweener.as: Line 1002: There is no property with the name 'metaError'.
trace("## [Tweener] Error: " + pTweening.scope.toString() + " raised an error while executing the 'onError' handler. Original error:
" + pError + "
onError error: " + metaError);
Total ActionScript Errors: 12 Reported Errors: 12
Can anyone tell me what is going on here?
If you can you are the most awesome person on earth.
Trouble With Tweener
I am trying the tweener classes because I got frustrated of the limitations that the default tweens have.
So I downloaded tweener_1_31_74_as2 and copied the contents inside the folder the test.fla was, imported the classes and tried out a simple animation:
ActionScript Code:
import caurina.transitions.*;
Tweener.addTween(ball, { x:400, y:300, time:1 });
The following errors appeared when compiling:
## [Tweener] Error: The property 'y' doesn't seem to be a normal object property of [object Object] or a registered special property.
## [Tweener] Error: The property 'x' doesn't seem to be a normal object property of [object Object] or a registered special property.
Any ideas?
Thanks.
Tweener Engine
I just started using this tweener engine and I am enjoying it, but I have a question about it. I google it to download the caurina files from the official site. I then ran across some demo files on the site and downloaded them, but they seemed to have a different version of the caurina files with them. I ran into problems with the color property with one set of the files, and one set had an extra folder called properties in it. Does anyone know what the right version is? Thanks.
Tweener Class
I wanted a movieclip to appear and disappear after the push of a button. I tried:
on(release){
import caurina.transitions.Tweener;
Tweener.addTween(mymovieclip, {_alpha:100, time:2});
Tweener.addTween(mymovieclip, {_alpha:0, time:2});
}
On the other hand:
on (release){
import caurina.transitions.Tweener;
Tweener.addTween(mymovieclip, {_alpha:0, time:2});
}
and
on (release){
import caurina.transitions.Tweener;
Tweener.addTween(mymovieclip, {_alpha:100, time:2});
}
work fine.
How can I accomplish it?
Tweener Not Working
I'm trying to import the Tweener class and apply it in the most simple fashion, just to see if it will work. Here what I've done:
I download the AS2 version of Tweener, since I'm working in Flash 8. I unzipped it, and put the "caurina" directory inside a directory "classes" which sits next to my FLA.
In the FLA, I go to Publish Settings --> ActionScript 2.0 Settings, and set the class path as this: classes
On frame 1, I've got this command:
import caurina.transitions.Tweener;
On frame 5, I've got this command:
fadeButton.onRelease = function () {
Tweener.addTween(this.mymc, {_alpha:0, time:1, transition:"linear"});
trace ("fading");
}
stop ();
On the stage (on a different layer), I've got 2 objects: a button (called fadeButton) and a black box saved as a Movie Clip, with instance name "mymc".
Based on all this, I would expect to click the Fader button, and see the black box fade out over 1 second. But nothing happens at all.
I believe my problem is with the class path or the import command. I've never used either one of those before. Any ideas?
Call Tweener From Within A MC?
Hi,
I have a MC and when i reach a keyframe i want to call a Tweener,addTween function
but I cant get it to work, may be because this is madness or not posible but if is posible can you let me know how?
Yes I know I can call a function that triggers the Tweener on the main time line but...
Thanks
rS
OnResize And Tweener
I have my stage to listen to the RESIZE event and position elements accordingly - this is fine. I also have a movieclip that responds to Tweener (to move and play the movieclip at the same time). At this point, the movieclip blips or jumps (almost like the stage resize event is still working) and then tweens.
My question is, could the resize event affect the Tweener, causing some weird convulsion?
Here's my resize function:
Attach Code
** Inside document class **
public function DocClass()
{
addChild(mc); //adding multiple mc's to the stage
reSize();
stage.addEventListener(Event.ADDED, onResize);
stage.addEventListener(Event.RESIZE,onResize);
stage.align = "TL";
stage.scaleMode = "noScale";
}
public function reSize()
{
mc.x = stage.stageWidth/2; //move elements accordingly
}
public function onResize(e:Event)
{
reSize();
}
LineTo Tweener
sorry for double post i hit enter by mistake.
Edited: 06/03/2008 at 08:16:32 AM by ++ Barry ++
LineTo Tweener
Hi.
I am trying to find a tutorial or really simple example code on how to tween a line being drawn using tweener and maybe lineTo? I need the line to draw go from its start position to a random position on screen and continiually do this until the movie is ended. At all time drawing a line not just tweening the movement of an object across the sceen.
Can anyone point me to a tutorial or provide some basic code to do this?
Thanks
Barry.
Using Tweener With An Xml Gallery
if any one can help me with this id be grateful, basically i did the kirupa tutorial for making an xml gallery with scrollable thumbnails, it all works well ,i just want to know if it possible to animate the thumbnails with a rollover etc with mc tweener because mine isnt working .Any way heres the code
import caurina.transitions.Tweener;
var movepic : Object = {
_alpha:0,
_y:-28,
time:1,
transition: "Sine"
}
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._heig ht)) {
if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=(hit_left._x+40)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+19)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
Tweener.addTween(this.target_mc,{base:movepic});
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 50;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
2 More More Tweener Tweens At Once
I have completley forgotten how to tween two at once, its something like
ActionScript Code:
Tweener.addTween [(sprite1, { time:1, y:20, transition:"easeInOutExpo" } )], [(sprite2, { time:1, y: -20, transition:"easeInOutExpo" })];
but its not that, i can remember that there's []'s in there, but I just cant remember where
thanks
Problems Using Tweener
I'm using tweener in order to play through an embedded video inside a movieclip. The movie is relatively small sized (about 100kb) and whilst tweener works perfectly at playing it normally, when i try to play the clip backwards to its original position, the motion is quite jerky and some frames are missed out.
the code i'm using is:
back_btn.onRelease = function() {
Tweener.addTween(work_mc,{_frame:1, time:1.6, transition:"linear"});
};
I'm using the latest stable release for AS2
I was just wondering whether anyone else has had similar problems and if they could suggest any remedies to fixing the situation? I'm just looking for an easy way to quickly return back to reverse the video, but retain the same quality of motion as the original playback.
TweenLite Vs Tweener
Been looking for a good resource that puts the two suites side by side, but didn't come up with anything comprehensive. Anyone have any insightful resources, or done any research on your own? I'm talking about speed, feature set, memory efficiency, etc.
Looping Tweener....
I can't seem to figure out how to create an infinite looping animation. I've got a ring that pulses and fades out from behind a circle. I want it to continue endlessly, but only get it to work once. Anyone help? My code for the tween is below...
Code:
Tweener.addTween(pulse_mc, {alpha: 0, scaleX:1, scaleY:1, time:1.5, transition:"easeInOutSine"});
Tweener Problems...
I'm having problems with Tweener. Here's the addTween
Code:
Tweener.addTween(getChildAt(1), {alpha:0, time:2}) ;
but nothing happens. The child at 1 could be anything from a Loader object to a library asset, but in all cases if I say
Code:
var mc:* = getChildAt(1) ;
mc.alpha = .5 ;
it works.
I don't even know where to look for the problem. I'm not getting any compiler or runtime errors. Tweener is set up fine and works in other places. I've tried casting, strict data typing, etc., to the var with no change. Anybody know what I'm doing wrong here?
Thanks.
Tweener And _frame
I've got this little piece of code:
Code:
import caurina.transitions.Tweener ;
import caurina.transitions.properties.DisplayShortcuts ;
import flash.events.MouseEvent ;
Tweener.init(this.stage) ;
DisplayShortcuts.init() ;
anim.addEventListener(MouseEvent.MOUSE_OVER, overHandler) ;
function overHandler(e:MouseEvent):void {
Tweener.addTween(anim, {_frame:20, time:2}) ;
}
anim.addEventListener(MouseEvent.MOUSE_OUT, outHandler) ;
function outHandler(e:MouseEvent):void {
Tweener.addTween(anim, {_frame:1, time:2}) ;
}
, which works perfectly with anim being an instance on the stage. But now if I make a dynamic list of objects, hundreds of them, I can't code it all by hand so I use a loop and do this:
Code:
for(var i:uint=0 ; i<100 ; i++) {
stack[i].addEventListener(MouseEvent.MOUSE_OVER, overHandler) ;
stack[i].addEventListener(MouseEvent.MOUSE_OUT, outHandler) ;
}
function overHandler(e:MouseEvent):void {
Tweener.addTween(e.target, {_frame:20, time:2}) ;
}
function outHandler(e:MouseEvent):void {
Tweener.addTween(e.target, {_frame:1, time:2}) ;
}
It doesn't work!!
Why doesn't it work?
It's the e.target that's confusing things. But WHY!!?
Tweener Problem
I have been trying to follow along with Lee's After Effects and Flash tutorial, although every time I run it i get this error:
Code:
## [Tweener] Error: the property '_frame' doesn't seem to be a normal object property of [object ticket_1] or a registered special property.
I have the newest version of Tweener and nothing in the change log says anything about removing the "_frame" property since Lee posted that video.
Any help with this would be greatly appreciated!
~S!ck
Rollover Tweener HELP
I just followed the video tutorial of AE and Flash. I can't get the code to work. I've modified it so
I don't get any errors now, but the problem is when I test movie my button disapears, until I roll over
it with the mouse. Then as soon as I roll off it disappears again.
Code:
import caurina.transitions.*;
butt.addEventListener(MouseEvent.MOUSE_OVER, butt_ROLLOVER);
function butt_ROLLOVER(e:MouseEvent):void
{
Tweener.addTween(ticket,{_frame:19,time:0.3,transition:"linear"});
}
butt.addEventListener(MouseEvent.MOUSE_OUT, butt_ROLLOUT);
function butt_ROLLOUT(e:MouseEvent):void
{
Tweener.addTween(ticket,{_frame:0,time:1,transition:"linear"});
}
I have a dummy button (butt) on top of my MC (ticket).
Tweener Not Working
Just found this site and I'm loving it. I just followed thru the tutorial on how to use custom classes made by other people. (http://www.gotoandlearn.com/play?id=30) Then I was doing the tweener tutorial (http://www.gotoandlearn.com/play?id=45) and it isn't working. Looking on the forums here makes me wonder, should I put anything in the tweener zip (http://code.google.com/p/tweener/) somewhere else?
I made a folder on my desktop called Flash > Actionscript > com >
I unzipped the caurina folder here.
Went to flash and told it to look in the "file path/Actionscript" like in the 1st tutorial. (btw, the 1st tutorial worked fine, I did the Math2 example and it worked)
Then I did the tweener tutorial and after testing it, I get an error that the tweener definitions don't exist.
Thanks for the help.
Embed Tweener?
Ok! I have an issue. I have a heavily animated presentation for a corporate client. who is basically retarded. They would like to compile the swf themselves. so i sent them the complete source files. along with tweener but they keep having issues trying to publish the file - I've completely explained to them how tween just needs to be in the same folder as the FLA but this is not working. they are retarded.
so my question is... can I import tweener into say the library and get the same functionality? My goal is to just send them a FLA only and they'd be able publish in FLASH 8!!
THANKS FOR YOUR HELP!!
ResizeTo With Tweener?
Using MC TWEEN you were able to tween the width and height of a movie clip to a specific number...
with mc Tween:
myMC.resizeTo(359, 60, 1, "easeOutExpo");
is this possible w/ tweener? i've read the whole tweener page many times and i dont see documentation on how to do this properly..
i do not want to use _scale because this is based on a percentage._xscale and _yscale is also percentage based? i want to use exact numbers..
thanks in advanced for your help.
Tweener Problem
Hi
When I am using the Tweener my animations always animate from the center. Could anyone tell me how to move the anchor point?
Morphing With Tweener
Hi Guys,
I was trying to do some basic morphing but I was wondering how could I do it using the Tweener Class....
If anyone could help please, it would really be handy
Thanks
Papervision & Tweener
Hi Guys,
I just started using Papervision last night and I'm trying to do a very basic effect, two sided plane that spins. I have got the two sided plane rotating but I would like to add a slight blur as it spins. I'm assuming the best way to do this is with Tweener, please correct me if I'm wrong. Here is my code, I'm using Papervision Greatwhite. Any help is appreciated, you will see the Tweener code commented out in the onEnterframe function.
Code:
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import org.papervision3d.view.Viewport3D;
import org.papervision3d.scenes.Scene3D;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.materials.*;
import org.papervision3d.objects.primitives.Plane;
import org.papervision3d.render.BasicRenderEngine;
import caurina.transitions.Tweener;
public class PV3DBitmapFileMaterial extends Sprite {
private var viewport:Viewport3D;
private var scene:Scene3D;
private var camera:Camera3D;
private var bitmapFileMaterial:BitmapFileMaterial;
private var primitive1:Plane;
private var bitmapFileMaterial2:BitmapFileMaterial;
private var primitive2:Plane;
private var renderer:BasicRenderEngine;
public function PV3DBitmapFileMaterial():void {
//viewport = new BasicRenderEngine(width, height, scaleToStage, interactive);
viewport = new Viewport3D(550, 400, false, true);
addChild(viewport);
//instantiates a Scene3D instance
scene = new Scene3D();
//instantiates a Camera3D instance
camera = new Camera3D();
camera.zoom = 10;
//renderer draws the scene to the stage
renderer = new BasicRenderEngine();
//BitmapFileMaterial, doubleSided draws the color on both sides of the geometry normals
//Frontside setup
bitmapFileMaterial = new BitmapFileMaterial("front41.jpg");
bitmapFileMaterial.doubleSided = false;
//primitive = new Plane(material applied to object, width, height, wSegments, hSegments);
primitive1 = new Plane(bitmapFileMaterial, 380, 380, 3, 3);
//Backside setup
bitmapFileMaterial2 = new BitmapFileMaterial("front42.jpg");
bitmapFileMaterial2.doubleSided = false;
primitive2 = new Plane(bitmapFileMaterial2, 380, 380, 3, 3);
//Flip the back side
primitive2.rotationY = 180;
scene.addChild(primitive1);
scene.addChild(primitive2);
//set up enterFrame event
addEventListener(Event.ENTER_FRAME, onEnterFrame);
//define enterFrame Method, render the PV3D Scene and animate the primitive
function onEnterFrame(e:Event):void {
primitive1.rotationY += 2;
primitive2.rotationY += 2;
/*
//Was trying to use Tweener here
var filter:BlurFilter = new BlurFilter(100,100,BitmapFilterQuality.MEDIUM);
var filters_array:Array = new Array();
filters_array.push(filter);
primitive1.filters = filters_array;
Tweener.addTween(primitive1,{_blur_blurX:0,_blur_blurY:0, time:2});
*/
renderer.renderScene(scene, camera, viewport);
}
}
}
}
Tweener Question
Hi there,
I'm wondering why I always have to re import the tweener class if I'm in a different level of my flash movie. I've created a document class and imported there but if I use it inside a movieclip it says "1120: Access of undefined property Tweener". Shouldn't it work anywhere ?
I've created a custom classes folder on my mac and added it in my preferences and refer to that location on import. Why won't it work ?
thanks
k
Tweener Question
I want to know if there is any advantage using Tweener instaed of the normal Tween calss???
|