Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-29-2006, 11:38 AM   #1
Marv_pb
Registered User
 
Join Date: Jun 2006
Posts: 5
Default fade on text component?

So I've created a scrolling text component as a selfcreating movie clip that populates itself with a .as file. Which works great. But. For the life of me I can't work out how to make this transition on... all I'm after is a fade or blur or animating mask. I'm presuming I need an import command for a filter or tween, and then set the variables... But being new to actionscript I'm a bit confused to where they need to go... if anyone can help It'd be very much appreciated... here's the code I have so far:

import flash.geom.Rectangle;
import mx.utils.Delegate;
import mx.controls.UIScrollBar;

var rWin:Rectangle;
var csb:UIScrollBar;
var mcHolder:MovieClip;
var tDisplay:TextField;

#include "hometext.as"

function onScroll(oEvent:Object):Void {
tDisplay._y = -csb.scrollPosition;
}

function init():Void {
var nWidth:Number = 300;
var nHeight:Number = 200;
rWin = new Rectangle(0, 0, nWidth+5, nHeight);
mcHolder = createEmptyMovieClip("mcHolder", 1);
mcHolder._x = 25;
mcHolder._y = -10;
mcHolder.scrollRect = rWin;

var tf:TextFormat = new TextFormat();
tf.font = "Helvetica";
tf.size = 12;
tf.leading = 2;
tf.color = 0x00A1B3;
tDisplay = mcHolder.createTextField("tDisplay", 1, 0, 0, nWidth, nHeight);
with(tDisplay){
border = false;
multiline = true;
embedFonts = true;
wordWrap = true;
autoSize = "right";
text = sText;
setTextFormat(tf);
antiAliasType = "advanced";
}

csb = createClassObject(UIScrollBar, "csb", 2, {_x: mcHolder._x + mcHolder._width + 10, _y: mcHolder._y});
csb.setScrollProperties(nHeight, 0, tDisplay._height - nHeight);
csb.setSize(csb.width, nHeight);
csb.addEventListener("scroll", Delegate.create(this, this.onScroll));
}


init();
Marv_pb is offline   Reply With Quote
Old 06-29-2006, 01:46 PM   #2
Paerez
Chick dig raccoons
 
Paerez's Avatar
 
Join Date: Apr 2005
Location: Maryland / Massachusetts
Posts: 1,104
Send a message via AIM to Paerez
Default

I heard with text you have to embed the font to get things like alpha to work.
Paerez is offline   Reply With Quote
Old 06-29-2006, 02:16 PM   #3
Marv_pb
Registered User
 
Join Date: Jun 2006
Posts: 5
Default

The font is already embedded (in mcHolder) The instance on the stage is blank, but still has the embed font options selected. As it doesn't work without , I'm presuming this is right?
Marv_pb is offline   Reply With Quote
Old 06-29-2006, 02:27 PM   #4
Paerez
Chick dig raccoons
 
Paerez's Avatar
 
Join Date: Apr 2005
Location: Maryland / Massachusetts
Posts: 1,104
Send a message via AIM to Paerez
Default

so what exactly are you trying to do? Fade it in? You haven't written the code yet right?
Paerez is offline   Reply With Quote
Old 06-29-2006, 03:11 PM   #5
Marv_pb
Registered User
 
Join Date: Jun 2006
Posts: 5
Default

No, I'm not sure what I need to do...

Here's an example of what I have so far...

http://www.videofridge.com/pb/pb_01.html

So... I want to Fade on the text box under the "mcGetstarted" instance over 16 frames.

So I Imagine the code would be something like:

import mx.transistions.Tween;
var mc:MovieClip;
var tw:Tween = new Tween(mc, "_alpha", mc._alpha, mc._alpha + 100, 16, false);

Or am I way off?
Marv_pb is offline   Reply With Quote
Old 06-29-2006, 03:28 PM   #6
Paerez
Chick dig raccoons
 
Paerez's Avatar
 
Join Date: Apr 2005
Location: Maryland / Massachusetts
Posts: 1,104
Send a message via AIM to Paerez
Default

I am not familiar with the Tween class, but that looks right.

I usually hand-code my animations with intervals.
Paerez is offline   Reply With Quote
Old 06-29-2006, 03:53 PM   #7
Marv_pb
Registered User
 
Join Date: Jun 2006
Posts: 5
Default

Keep getting error message saying can't load the Tween...

**Error** Symbol=homeContent, layer=actions, frame=36:Line 43: The class or interface 'mx.transistions.Tween' could not be loaded.

Marv_pb is offline   Reply With Quote
Old 06-29-2006, 04:22 PM   #8
Paerez
Chick dig raccoons
 
Paerez's Avatar
 
Join Date: Apr 2005
Location: Maryland / Massachusetts
Posts: 1,104
Send a message via AIM to Paerez
Default

mx.transistions.Tween -> mw.transitions.Tween
Paerez is offline   Reply With Quote
Old 06-30-2006, 10:13 AM   #9
Marv_pb
Registered User
 
Join Date: Jun 2006
Posts: 5
Default

nope... still error message...

My brain is about to leak out of my ears.
Marv_pb is offline   Reply With Quote
Old 06-30-2006, 10:37 AM   #10
mooska
fl.mooska._title
 
mooska's Avatar
 
Join Date: Jun 2006
Location: lodz
Posts: 1,211
Send a message via ICQ to mooska Send a message via Skype™ to mooska
Default

Pearez meant
mx.transitions.Tween
__________________
pebkac - problem exists between keyboard and chair

Have something to code ?

asql
mooska is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
one template, many looks? subquark ActionScript 1.0 (and below) 1166 10-29-2013 06:18 PM
Optimizing Flash Web Sites for Search Engines rockcoastmedia General Chat 19 03-29-2009 09:31 PM
Problem with: Text Area Component silverlunchbox Components 9 09-30-2006 12:23 AM
CyanBlue's 5000th Post - Useful Threads List CyanBlue Projectors and CDs 104 02-25-2005 01:13 PM
Help with HTML in dynamic text field... puckett_jw ActionScript 1.0 (and below) 8 08-04-2003 12:58 AM


All times are GMT. The time now is 06:30 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.