Apply Filter @ Runtime
hi everybody.
I've got 4 dynamic TextFields inside a MovieClip. on onRollOver I want to apply a DropShadowFilter to this MovieClip, and on onRollOut I want to remove the DropShadowFilter.
pretty simple task, I hope ..how do I do it?
here's my onRollOver and onRollOut-code:
ActionScript Code: allContainer_mc.textHolder10.onRollOver = function(){ trace("onRollOver");}//allContainer_mc.textHolder10.onRollOut = function(){ trace("onRollOut");}
thanks
Ultrashock Forums > Flash > Flash Newbie
Posted on: 2007-08-21
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Bitmapdata, Apply Filter To One Channel? Realease A Filter
Hi there, I have two question:
Is it possible to apply a filter only to one channel or to access only one channel?
I've found somewhere:
Display.BitmapData.Channel.ALPHA
Is it something we can access at runtime?
When I appply a filter to a Bitmapdata, the Bitmapdata isn't really modified but just filtered, so if for example I copy one of its channel to another bitmapdata, I copy the source bitmap without the filter...
What I'd like to do is "release" the filter so it definetely modify the image. Is it a function to do so or can I only perform this by doing a screenshot of my MovieClip?
Thank you inadvance for your help.
[F8] Apply Filter To Mc Drawn With Api
Obvioulsy I'm blind.... WHY is't this code working...??!!!!!
Code:
import flash.filters.GlowFilter;
this.createEmptyMovieClip("mc_line",1);
with ("mc_line"){
lineStyle(20, 0xd1bca3,100);
_root.moveTo(0, 160);
_root.lineTo(Stage.width, 160);
// glow on the line
var glow:GlowFilter = new GlowFilter(0x003a68, 0.5, 0, 10, 5, 10,true);
var myTempFilters:Array = mc_line.filters;
myTempFilters.push(glow);
mc_line.filters = myTempFilters;
}
I've tried the glow-on-the-line part inside and outside the with statement.
The glow-on-the-line part works fine if I put an instance of a movie clip on the stage but not as above...
Why?!
I'd be greatful for a hint in the right direction...
Apply Website Transition Filter?
Hey I'm new to AS , so I was wondering how would I go at attempting this?
On the website I'm building , I currently have it so when you click a link, it removes the current page and animates a new one, really simple, but how would I apply a filter transition? I downloaded a blur filter and installed it to flash cs3, so instead of just removing a page and motion tweening the new one, i would like to just do a motion blur tween between the current page, and the page clicked, how would I do that? This is my current code.
Should I upload the .fla file?
(EDIT) why wont it let me upload my code in CODE brackets? it gives me this error:
You have included 5 images in your message. You are limited to using 4 images so please go back and correct the problem and then continue again.
Change Color Then Apply Filter?
I have a simple circle movie clip in my library. The circle is green. I would like, at runtime, to change its color to blue, red, whatever. Then I want to apply a bevel filter to it.
The problem is that after I apply the color, the filter is ignored.
//First change color
var changeColor = new Color(mcCircle);
changeColor.setRGB(bitOnColor);
//Then apply filter
var innerBevel:BevelFilter = new flash.filters.BevelFilter();
var myFilters:Array = mcCircle.filters;
myFilters.push(innerBevel);
mcCircle.filters = myFilters;
Clearly I'm missing the point here. Anyone know the right way to do this? Thanks very much.
-jheske
Apply Text Filter Dynamically
How can I add a glow filter to a textfield via actionscript? I know the procedure for doing the same thing with a movieclip, but the TextField class (and TextFormat) don't seem to accept filters as a property?
What I have so far:
ActionScript Code:
import flash.filters.*;var text_glow:GlowFilter = new GlowFilter(0xFF0000, 80, 10, 10, 100, 3, false, false);var some_txt:TextField;//Want to apply filter to text field
Unable To Apply Blur Filter
The code below fades three mc instances into each other. The movieclip instances are called, picture1_mc, picture2_mc,picture3_mc. They are based on three bitmap images that also sit in the library. I manually converted the original bitmaps into movieclips on the stage area. The fade code works fine, but what I would like to do is allow the user to
mouse click and cause a blur effect whilst the images are cycling along. My problem is that Im not sure how to apply this within my mousedown function. The applyFilter method seems to call for bitmaps but I'm dealing with movieclips. Thanks for any guidance
import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.filters.BlurFilter;
var filter2:BlurFilter = new BlurFilter(Math.ceil(Math.random()*5), Math.ceil(Math.random()*5), 3);
init = function () {
currentIndex = 1;
currentLayer = 1;
howLongToWait = 0;
_root.attachMovie("picture1_mc", "pic1", 0);
addNewPic();
};
addNewPic = function () {
clearInterval(myInterval);
if (currentIndex%3 != 0) {
currentIndex++;
} else {
currentIndex = 1;
}
newlyAdded_mc = _root.attachMovie("picture"+currentIndex+"_mc", "pic"+currentIndex, currentLayer++);
newlyAdded_mc._alpha = 0;
newlyAdded_mc.onEnterFrame = function() {
this._alpha += 2;
if (this._alpha>=100) {
this.onEnterFrame = null;
myInterval = setInterval(addNewPic, howLongToWait*100);
}
};
};
// run init()
init();
onMouseDown = function ()
{
//problems here!!!!!!!!!
var pointoint = new Point(_root._xmouse, _root._ymouse);
var rec:Rectange = new Rectangle(100,100,6,6);
//problem applying filter
//????.applyFilter(?????,rect,point,filter2)
};
myListener = new Object();
Mouse.addListener(myListener);
[AS3.0] Apply Filter To TextField Programmatically
Hi there!
I tried this using
Code:
textField.filters = [new GlowFilter()]
or just like in Flash8 passing the .filters array ref to another array and pushing filter to that array [was it?], but none of these steps worked.
Applying filter to Sprite, within which the TextField (_title) is contained:
Code:
var tit:Sprite = new Sprite();
tit.addChild(_title);
tit.filters = [new GlowFilter(0xFFFFFF,1,5,5,2,2)]
addChild(tit);
worked, however this method (using extra sprite for a textfield) is just too dirty, let alone we want to apply filters to multiple textfields..
Anyone knows how to apply filter directly to TextField instance in AS3.0?
Thanks!
Apply Filter To Just One Bitmap Data, No The Others?
Greetings,
I was following lee's tutorial on how to create advanced effects on bitmap data (like using the blur filter). I am not used to working with bitmap data and don't find it's creation and structure intuitive. Something I am not understanding is how to just blur a single clip and build the draw loop so that only that clips bitmap data gets drawn and blurred while other clips stay untouched. Any object I put onto the main timeline ends up bluring. I tried creative a sprite that contained the clip and then targeted that sprite, but still, any clip, or any object on the stage was blured and redrawn. Any help would be appreciated. Thanks!
Code:
import caurina.transitions.*;
var bmd:BitmapData = new BitmapData(550, 400, true, 0x000000);
var bm:Bitmap = new Bitmap(bmd);
var s:Sprite = new Sprite();
addChild(s);
s.addChild(bm);
var bf:BlurFilter = new BlurFilter(8, 8, 3);
var cmf: ColorMatrixFilter = new ColorMatrixFilter([1,0,0,0,0,
0,1,0,0,0,
0,0,1,0,0,
0,0,0,1,0]);
var logo:Logo = new Logo();
s.addChild(logo);
logo.scaleX = logo.scaleY = .14;
function mover(){
var myY:Number = Math.random()*stage.stageHeight;
var myTrans:String
myY <= logo.y ? myTrans = "easeOutExpo" : myTrans = "easeOutBounce";
Tweener.addTween(logo,{x:Math.random()*stage.stageWidth,
y:myY, time: 1,
rotation:Math.random()*300, onComplete:mover,
transition:myTrans});
}
mover();
addEventListener(Event.ENTER_FRAME, loop);
function loop(e:Event):void{
bmd.draw(s);
bmd.applyFilter(bmd, bmd.rect, new Point(0,0), bf);
bmd.applyFilter(bmd, bmd.rect, new Point(0,0), cmf);
bmd.scroll(0, -5);
}
Apply Animated Filter To An Image
I'm at war with this code for a week now .. I managed to get ripple effect, but it doesn't apply to image positioned behind. So I need some directions on how to achieve that.
Right now the image is steel and doesn't move with the ripples. Any help is appritieted
The code itself is in 2 classes, first is Ripples.as
Code:
package
{
import flash.display.Sprite;
import flash.events.*;
import RippleCanvas;
public class Ripples extends Sprite {
private var subobj:RippleCanvas;
public function Ripples() {
trace("Ripples Initialized");
var subobj = new RippleCanvas();
this.addChild(subobj);
}
}
}
And second is RippleCanvas.as
Code:
package
{
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.events.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.display.BlendMode;
public class RippleCanvas extends Sprite
{
internal var sourceBmp:BitmapData;
internal var paintBmpData:BitmapData;
internal var paintBmpData2:BitmapData;
private var buffer:BitmapData;
private var paintBmp:Bitmap;
private var output:Bitmap;
private var brush:Sprite;
private var logo:Sprite;
private var filter:BitmapFilter;
private var filter2:BitmapFilter;
private var disp:BitmapFilter;
private var outputBmpData:BitmapData;
private var surface:BitmapData;
internal var pt = new Point(0,0);
internal var matrix1 = new Matrix();
public function RippleCanvas()
{
paintBmpData = new BitmapData(128, 98, false, 0x40);
//new image(166,240);
paintBmpData2 = new image(166,240);
//new BitmapData(128, 98, false, 0x40);
logo = new Sprite();
brush = new Sprite();
brush.graphics.beginFill(0xFFFFFF,1);
brush.graphics.drawCircle(0,0,4);
trace ("RIppleCanvas started..");
// surface = new BitmapData(128, 98, true, 0x000000);
surface=new image(166,240);
surface.blendMode = BlendMode.ADD;
surface.draw(logo);
sourceBmp=new image(166,240);
sourceBmp.blendMode = BlendMode.ADD;
// sourceBmp = new BitmapData(128, 98, false, 0x40);
buffer = paintBmpData.clone();
outputBmpData = new BitmapData(128, 98, false, 0x40);
//new image(166,240);
scaleX = 8.0;
scaleY = 8.0;
this.addEventListener(MouseEvent.MOUSE_DOWN, this.downEvent, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_UP, this.upEvent, false, 0, true);
this.addEventListener(Event.ENTER_FRAME, this.update, false, 0, true);
paintBmp = new Bitmap(paintBmpData);
var cmat:Array = [ 1, 1, 1,1, 1, 1, 1, 1, 1 ] ;
filter = new ConvolutionFilter(3, 3, cmat, 9, 0);
filter2 = new BlurFilter(4,4);
output = new Bitmap(outputBmpData);
// output.blendMode = BlendMode.ADD;
// paintBmp.blendMode = BlendMode.ADD;
addChild(output);
addChild(paintBmp);
//var tf = new TextField();
//tf.text = "testing123";
//addChild(tf);
disp = new DisplacementMapFilter(paintBmpData2, new Point(), 4, 4, 48, 48, DisplacementMapFilterMode.IGNORE );
this.filters = new Array(new BlurFilter(16, 16));
this.blendMode = BlendMode.ADD;
}
function update(e:Event)
{
if(parent!=null){
var localPt:Point = parent.globalToLocal(new Point(parent.mouseX*0.125, parent.mouseY*0.125));
var m:Matrix = new Matrix();
m.translate(localPt.x, localPt.y);
sourceBmp.draw(brush, m, null, 'invert');
}
trace (localPt);
paintBmpData.applyFilter(sourceBmp, paintBmpData.rect, pt, filter);
paintBmpData.draw(paintBmpData, matrix1, null, 'add');
paintBmpData.draw(buffer, matrix1, null, 'difference');
paintBmpData.draw(paintBmpData, matrix1, new ColorTransform(0, 0, 0.98609374, 1, 0, 0, 2, 0));
paintBmpData2.draw(paintBmpData, matrix1);
outputBmpData.applyFilter(surface, outputBmpData.rect, pt, disp);
buffer = sourceBmp;
sourceBmp = paintBmpData.clone();
}
public function downEvent(e:Event)
{
if(e.stageX == 0 && e.stageY == 0)
return;
var curPt:Point = parent.globalToLocal(new Point(e.stageX, e.stageY));
e.stopPropagation();
}
public function upEvent(e:Event)
{
e.stopPropagation();
}
}
}
Code itself is in a mess right now as I tryed every single combination, without any success.. so plz help
How To Apply Blur Filter On Image In Different Layer?
I have one load which loads image randomly from external folder.
and another layer which has 5 columns. I wish to do a mouse over thing and one of the column will become blur.
I tried to use the blur filter, but can't seem to get it work on image that loads randomly from external folder.
this is the action script code I used for loading external images:
Quote: pic_arr = ["images/1", "images/2", "images/3", "images/4", "images/5"];
onLoad = function() {
ranNum = Math.floor(Math.random()*pic_arr.length);
holder_mc.loadMovie(pic_arr[ranNum]+".jpg");
};
any help?
Unable To Apply Blur Filter On Mouse Down Event
The code below fades three mc instances into each other. The movieclip instances are called, picture1_mc, picture2_mc, picture3_mc. They are based on three bitmap images that also sit in the library. I manually converted the original bitmaps into movieclips on the stage area. The fade code works fine, but what I would like to do is allow the user to
mouse click and cause a blur effect whilst the images are cycling along. My problem is that Im not sure how to apply this within my mousedown function. The applyFilter method seems to call for bitmaps but I'm dealing with movieclips. Thanks for any guidance
import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.filters.BlurFilter;
var filter2:BlurFilter = new BlurFilter(Math.ceil(Math.random()*5), Math.ceil(Math.random()*5), 3);
init = function () {
currentIndex = 1;
currentLayer = 1;
howLongToWait = 0;
_root.attachMovie("picture1_mc", "pic1", 0);
addNewPic();
};
addNewPic = function () {
clearInterval(myInterval);
if (currentIndex%3 != 0) {
currentIndex++;
} else {
currentIndex = 1;
}
newlyAdded_mc = _root.attachMovie("picture"+currentIndex+"_mc", "pic"+currentIndex, currentLayer++);
newlyAdded_mc._alpha = 0;
newlyAdded_mc.onEnterFrame = function() {
this._alpha += 2;
if (this._alpha>=100) {
this.onEnterFrame = null;
myInterval = setInterval(addNewPic, howLongToWait*100);
}
};
};
// run init()
init();
onMouseDown = function ()
{
//problems here!!!!!!!!!
var point:Point = new Point(_root._xmouse, _root._ymouse);
var rec:Rectange = new Rectangle(100,100,6,6);
//problem applying filter
//????.applyFilter(?????,rect,point,filter2)
};
myListener = new Object();
Mouse.addListener(myListener);
Sandbox/runtime Filter Issues?
Hi,
I don’t know if anyone has ever run into this problem before or not but I am applying several filters to varoius movieclips at runtime in actionscript but I keep receiving a sandbox violation when the filters are applied.
The error message is
-----------------------------------------------------
*** Security Sandbox Violation ***
SecurityDomain 'http://www.artlineltd.dev/flash/newBackground.gif' tried to access incompatible context 'file:///Z|/artlineltd.dev/www/Flash/FeaturedArtistsEff.swf'
-----------------------------------------------------
'http://www.artlineltd.dev/flash/newBackground.gif' is not being affected by the filters and I have added this code (System.security.allowDomain("*"); ) to the top of my actionscript to avoid sandbox issues. It seems to work but is that a bad practice and does anyone know what could be causing this error to pop up?
I am using a bevel, drop shadow effect and color matrix filter and I imported the effects with this code (import flash.filters.*; ) before I referenced them
var myOutlineFilter = new flash.filters.BevelFilter(1, 45, 0xCCCCCC, 1, 0xCCCCCC, 1, 1, 1, 1000, 2, "outer", false);
var myDropFilter = new flash.filters.DropShadowFilter(5, 45, 0x000000, 1, 5, 5, .41, 2, false, false, false);
function applyImageFilters(featuredImage) {
var myOutlineFilterArray:Array = featuredImage.filters;
myOutlineFilterArray.push(myOutlineFilter, myDropFilter);
featuredImage.filters = myOutlineFilterArray;
}
thanks
Apply Glow Filter On Target MC While Dragging An Object And Rolling Over The Target
I can get my filter to apply to a movie clip if i simply rollover or roll out of it. When the mouse rolls out, the filter is set to undefined. The problem I am having is that I want the object that is in effect the hit area to glow (have a filter applied) when the draggable object is being dragged over it.
This would make is easier for the user to visually identify that where they are currently hovering over, whilst dragging, is the area that they should drop the object.
Part of my code looks like this
Code:
this.onRollOver = function () {
if(_global.isDragging == 1){
this.filters = glowFilterArray;
}
}
this.onRollOut = function () {
_global.isDragging = 0;
this.filters = undefined;
}
_global.isDragging is set to 1 at the onPress stage, when startDrag occurs.
_global.isDraggin is set to 0 onRelease of the draggable object.
Are there any ideas for a solution?
Colormatrix Filter And Blur Filter Tween
Last edited by sks447 : 2006-10-17 at 15:11.
I want to have a picture fade from blurry and grayscale to sharp and colorized. I have the blur to sharp part working ok. I have the grayscale to color to working ok. The only thing is the filters dont work together. Ive tried to push one into another with no luck yet. You can see the comments in the code below. Thanks.
ActionScript Code:
function blurFunction(myVar) {
// init what movieclip to blur
if (myVar == undefined) {
myVar = promoContainer.p1;
}
// BLUR FILTER
import flash.filters.BlurFilter;
import flash.filters.BitmapFilter;
import flash.filters.ColorMatrixFilter;
var blurFilter:BlurFilter = new BlurFilter(0, 0, 3);
desaturation = 1;
var filterArray:Array = new Array();
filterArray.push(blurFilter);
var blurX:Number = 100;
var blurY:Number = 100;
onEnterFrame = function () {
prevPromo._visible = false;
nextPromo._visible = true;
if (desaturation>=1) {
des = -0.03;
} else if (desaturation<=0) {
des = 0;
delete (onEnterFrame);
}
desaturation += des;
// color matrix
//myVar.filters = new Array(getDesaturationFilter(desaturation)); <---- I can have this....
blurX -= 10;
blurY -= 10;
blurFilter.blurX = blurX;
blurFilter.blurY = blurY;
// blur filter
//myVar.filters = filterArray; <---- Or I can have this but not both.......
if (blurY<=0) {
blurY=0;
blurX=0;
//delete (onEnterFrame);
}
};
}
function getDesaturationFilter(t:Number):BitmapFilter {
t = t != undefined ? t : 1;
var r = 0.212671;
var g = 0.715160;
var b = 0.072169;
trace("colormatrixfilter called");
return new ColorMatrixFilter([t*r+1-t, t*g, t*b, 0, 0, t*r, t*g+1-t, t*b, 0, 0, t*r, t*g, t*b+1-t, 0, 0, 0, 0, 0, 1, 0]);
}
[F8] Possible To Set Runtime Sharing Path At... Runtime?
After a weekend of pulling my hair out on this problem it looks like the paths for runtime sharing are relative to the HTML page, not the SWF. This is a problem because the client wants to be carefree in distributing the SWFs around the server. (In fact is demanding it.) So I need a way to set the runtime sharing path at runtime.
Or put another way...
"child.swf" is looking for fonts and graphics in "master.swf" If I move them all (including "master.swf") to some/random/folder/ and embed them from a HTML page at /a/different/folder/ the linkage breaks, even though the files load fine. (The paths to the SWFs are sent via XML.)
Any ideas? I really can't hard-code this and I probably can't compile new versions each time they feel like moving stuff around.
Worst case I'll skip the runtime sharing, but it would make the files needlessly big and slow.
(Publishing to Flash 8 AS2)
How Do I Preload Runtime Shared Libraries Without "import For Runtime Sharing"?
Hi, i have a big shared font library. I want all the font symbols to reside in fonts.swf. I have a loader.swf loading main.swf, and fonts.swf. Even though fonts.swf loads completely, the fonts aren't available to main.swf. I don't want to choose import for the font symbols in main.swf, because that will make Flash compile fonts.swf every time I publish main.swf, won't it? How can I get main.swf to use fonts in fonts.swf without "import in first frame"?
Thanks!
Changes Won't Apply...
When ever I use a tool, I do stuff with it... but when I release the mouse button, the changes undo themselves. For example, I'd erase something, then release the button, and the thing would just pop back up. How do I fix this?
Apply
Hi, the main movie of my website loads the following movies:
loadMovieNum("main_menu.swf", 10);
loadMovieNum("news.swf", 2);
loadMovieNum("grid.swf", 1);
I have a button on mc "main_menu.swf". When this button is pressed I want mc "grid.swf" to:
gotoAndPlay('play');
I have been trying "_root.grid.gotoAndPlay('play');" amongst others but no joy.
Is this possible?
many thanks
How To Apply A Preloader
I have a flash movie which is big in size. I want a preloader to run it. So now I made twoflash files. One heavy main file and one small flash file. Now how to make to small flash file run till the larger main file loads. I think I have to use an Applet, but which one and how I do not know? Please help
siddharth
Please Help- I Have A Concept And I Don't Know How To Apply It
Hello
I have this concept for my portfolio site which is a mix of flash and html graphics-
I want my flash movie to be semi faded when the mouse it not over it but when the mouse goes over it, it is fully shown-
I know this can be done trhough telltarget/with with a movie clip- and a invisible buttom-
but that means I have to put a big invis. buttom on my movie and that will make the whole area clickable which i don't want-
is there a way to do it with clipevent or something- please help me out or direct me to a tutorial that shows this
thnx
I Have This Concept And Don't Know To Apply It
Hi, I have this idea for my site and don't know how to apply it
My web site is half html images and half flash- I want to make the flash parts semi tranparent but when the mouse goes over it they would be fully shown- what i have done is i made put a M/C on the top of my movie timeline and used tell target to control the look of it- this part i have no problem with-
but the part i have problems with is how to control the m/c
i tried the invis. buttons but that would make the whole flash part clickable which is not what i want- i tried onclip event but it doesn't work as good as I wanted it to work-
any suggestion-
I also thought of having a timer if the mouse is not active in X- sec tell target/with my white MC. but i don't know how to do that either.
please help me thnx shane
Please Tell Me How Apply THIS Technique
I saw this website
http://www.craigdavid.co.uk/site/home.php
and I really like the technique used for the sliding banner. Could anyone give me a clue how they did that please? I think it seems like a popular technique now
Thank you very much
Peddie
Apply Stroking
Is there a way to apply a stroke to an object in Flash?
How To Apply Javascript
Great thanks to Nordberg for supplying the following javascript to open a file in a new seperate window sized 500 x 250.
on (release) {
screenX = System.capabilities.screenResolutionX
screenY = System.capabilities.screenResolutionY
getURL("java script:NewWindow=window.open('yourpage.asp','windo wname','width=500,height=250,top="+((screenY -250)/2)+",left="+((screenX -500)/2)+" ,toolbar=No,location=No,scrollbars=No,status=No,re
sizable=No,fullscreen=No'); NewWindow.focus(); void(0);");
Only problem is,I don't know what to do with it. I tried inserting into the getURL action field and it woudn't take it. I tried using expert mode and it said there's errors in the code when trying to get back to normal mode.
Also do I need to replace my file name with 'yourpage.asp' or 'windowname'?
Anyone know how or where to insert this code?
Thanks!!!!!!!!!!!!!!!!
Apply Function
Hi
I've built a tree menu.
when u click on a button it changes its font color and it's being underlined.
I've done that by using the button text as html and then on(release) set the different variables to the html code needed. This works very fine, only if i add another buttton to the tree menu i have to change the script of all the 30 other buttons too.
Now i had an idea, maybe i could define a function with resets all html codes to the starting position
if i click on a button flash should
run the function
and then set the code of the clicked button
to do that i've added a script in the first frame
function reset() {
a = "hallo";
b = "you";
}
if i click on button A
on (release){
run reset ( dont know how to do that)
a = "<font color = "#FFFFFF"><u>hallo</u></font>"
}
but what script do i need to run reset????
seems complicated but it isn't
mainly i ask u what script do i need that a button executes a function??
thanx a lot
Gilo
Batch Apply?
I´m in the making of a site, and i´ve got many pictures, that should fade in from alpha 50% to 100%. I´ve used the motion-tween and put it in a Movie Clip a million times. Is it possible to make some kind of batch apply on these pictures???? (imported jpegs, converted to bitmap, finally converted to grapich)
NEED HELP PLEASE.
MightyDane
Apply #include On The Fly
Hi
I have a menu that I'm trying to automize. In its present state, there are thumbnails already on the stage and I'm using #include to reference a separate *.as file that gives the thumbs behaviours.
Now instead I'm using attachMovie to create the thumbs. How can I apply a #include to the created thumbs using script?
Is there a simple way to do it using a class?
thanks
mark
flash8
Apply Some Pressure
Hi people,
Does anyone know how liquid crystal sheets work at all?
if not i will try and explain it. This sheet could be as big as A4 sized paper, visually, it looks black, nothing else. but if you where to place your hand on this sheet, the heat from your hand will effect the black ink, by fading to clear ( possibly to reveal the original colour underneath ) in this process of revealing of depending upon how long the hand is placed, a heat pattern, colours fading from red to green to slightly orange/brown.
now my question is i would like to replace the hand for the mouse cursor. so if i leave the mouse cursor in the same place it will cause a reaction and if you move the mouse cursor slowly left to right it leaves a trail behind.oh and the effect will always return to its original stat, which is black.
any indeas and if this is possible??
heres a link to what an lcr sheet is http://www.teachersource.com/catalog...aca7e1138bcde2
cheers
[F8] Why The FK Doesn't This CSS Apply?
I don't have much experience dealing the styles in flash but for some dumbfk reason, there are no underlines on <a> tags by default so I have to style them in. Pain in the arse.
Anyway, this seems simple enough but doesn't do sh*t.
Code:
import TextField.StyleSheet;
var mySS = new StyleSheet();
mySS.setStyle("hyper", {color:'#00FF00',fontWeight:'bold'});
myText = createTextField("myText",0,0,0,0,0);
myText.autoSize = true;
myText.styleSheet = mySS;
myText.html = true;
myText.htmlText = "<p class='hyper'>some text</p>";
How Do I Apply Gravity?
So i finaly figured out how to create opposing force! The problem is when i try to apply gravity my ball completely ignores the opposing force!
Paste this code into the first frame.
Code:
var magnet_radius:Number = 220;
var coefficient:Number = .05;
function distance( dx:Number, dy:Number ) : Number {
return Math.sqrt( dx * dx + dy * dy );
}
function offset( dist:Number ) : Number {
return ( magnet_radius - dist ) * coefficient;
}
function project( dist:Number, dx:Number, dy:Number ) : Object {
var theta:Number = Math.atan2( dy, dx );
var magnitude:Number = offset( dist );
return { x:Math.cos( theta ) * magnitude, y:Math.sin( theta ) * magnitude };
}
function run() : Void {
var dx:Number = _root.magnet._x - ball._x;
var dy:Number = _root.magnet._y - ball._y;
var dist:Number = distance( dx, dy );
if( dist < magnet_radius ) {
var projection:Object = project( dist, dx, dy );
ball._x -= projection.x;
ball._y -= projection.y;
}
}
this.onEnterFrame = run;
I have a Ball object and a Magnet object. I just put them close together and watch the reation.
Id like the ball object to act as though gravity were pushing it down.
Can't Apply Script To MC?
Hey everyone,
I am just starting my first AS 3.0 project and am very frustrated. Many of my techniques include assigning code to individual MCs but, to my understanding, this is not available in 3.0.
For an exaple, I wanted to do a simple blur in and out on a button when I rollOver or rollOut. In the past I would have coded it this way.
button script...
Code:
btnPlay.onRollOver = function(){
imgPlay.playingBackwards = false;
imgPlay.play();
}
btnPlay.onRollOut = function(){
imgPlay.playingBackwards = true;
}
and had this code on my movieclip...
Code:
onClipEvent(enterFrame){
if (playingBackwards) prevFrame();
}
My movieclip just contained a simple tween.
How is this set up in 3.0? I was receiving all sorts of errors that related to on(EnterFrame) events, and as I mentioned earlier, I cannot assign code to a MC.
Ugh. Why change the language!
Apply Css To Different Node
hello..
how do I apply the css to different nodes in the xml data? I have attached the file for you to take a look at. thank you.
How Do I Apply The Same Set Of Commands?
I am sorry if I am overlooking this, but this is hard to search for in the manual. If i want to go to an object, or keyframe, and transform it ...scale it, etc. and change color, or apply a transition... in other words, change more than one thing at a time, and I need to do this to a number of objects, can I record this (like in photoshop) and do the same changes again and again just by using a shortcut?
Cannot Apply Actions
I have a button that whenever I try to apply actions to it, it keeps saying,
"current selection cannot have actions applied to it." I have tried
applying actions to the button by double clicking on the button as well as
the movie stage. Either way I get the above message.
Any ideas what might be causing this message on a button?
--
Brandon
How Can I Apply Gradient...
I have a rectangular shape movie Clip (Size :130px X40 px). I want to apply linear gradient on it using action script. Can anybody help me how can I apply gradient on it.
Note: This movie clip is made manually. Not by using createEmptyMovieClip method.
Can't Apply The Logic?
hi all-
i have been working on a project for quite some time. and have been running into many problem... i have left previous threads, but still need more help. can someone please help me?
this is the links to my previous forum:
http://www.kirupaforum.com/forums/sh...357#post401357
i really appreciate all the help that i can get. can someone please just tell me what my issue might be so that i may look in the right direction. all i need is a little guidance.
-a8le
How To Apply Mask On Txt
hello,
i like to know how to apply a mask on txt when the "use device fonts" is selected.
I use to select " use device fonts " for a better display of the txt, so I can use little font(9 , 10) , and it still readable.
but than if I use the mask, my txt dissappear.
any idea how to solve this???
tanks
How Can I Apply This Effect
hey guys how can I apply the attached effect on a regular image, like without any clicking like image loads and it plays that effect. I want to be able to use this in my currene project that I am working on,
please anyone
thank you
How To Apply Maths
Hello there. Does someone knows a good tutorial or website that shows you how to use maths in flash starting from basics?
I will explain myself better: when i see codes with maths i go thru it and i understand why it work but when i want to start a math code by myself i cant figure out, i always need an example to start from.
Its not too important because when im on those situation i do a diagram of it with simple shapes and i put the numbers and that, but this method takes time
I hope that someone knows a good site about it
How To Apply Actions To This?
This is the code and my question is, where and HOW do i write my actions? My submenu sections is some external swf's called sub1.swf, sub2.swf, sub3.swf etc.
Cascading Menu v1.0
Simon Coulton (s_coulton@hotmail.com) - 8/5/2006
// Functions ------------------------------------------------------------------------
_global.$tweenManager.broadcastEvents = true;
// Main menu
function createMainMenu() {
var a = 1;
var total = mm_array.length;
while (a<=total) {
ypos = ((a-1)*homm)+1;
attachMovie("mainnav_mc", "mainnav"+a+"_mc", this.getNextHighestDepth()+100, {_x:0, _y:ypos});// attach the movieClip
var nc = this["mainnav"+a+"_mc"];
nc.menutext = mm_array[(a-1)];// set the title text for each button
nc.itemnum = a;// set the menu #
a++;
}
}
function moveMenu(num) {
if ((_root.collapsed == true) || (_root.selectedmenu != num)) {
var array = "sm"+num+"_array";
var totalsm = eval(array).length;
var totalmm = mm_array.length;
var a = 1;
while (a<=totalmm) {
mc = this["mainnav"+a+"_mc"];
if (a>num) {
var ypos = (((a-1)*homm)+1)+totalsm*(hosm+1);
mc.tween("_y", ypos, 0.5, "easeOutBack");
} else {
var ypos = ((a-1)*homm)+1;
if (a == num) {
nypos = ypos;
mc.tween("_y", ypos, 0.5, "easeOutBack", 0, onEnd(num, nypos));
} else {
mc.tween("_y", ypos, 0.5, "easeOutBack");
}
}
a++;
}
_root.collapsed = false;
} else {
contractMenu()
_root.collapsed = true;
}
}
function onEnd(num, nypos) {
_root.num = num;
createSubMenu(num, nypos);
}
function contractMenu() {
var c = 1;
while (c<=submenu_array.length) {
removeMovieClip("subnav"+c+"_mc");
removeMovieClip("mask"+c+"_mc");
c++;
}
var g = 1;
while (g<=mm_array.length) {
ypos = ((g-1)*homm)+1;
this["mainnav"+g+"_mc"].tween("_y", ypos, 0.5, "easeOutBack");
g++;
}
}
function createSubMenu(num, nypos) {
var array = "sm"+num+"_array";
var totalsm = eval(array).length;
var ypos = nypos+4;
var c = 1;
while (c<=submenu_array.length) {
removeMovieClip("subnav"+c+"_mc");
removeMovieClip("mask"+c+"_mc");
c++;
}
submenu_array = [];
var a = 1;
while (a<=totalsm) {
ypos = ypos+hosm+1;
attachMovie("subnav_mc", "subnav"+a+"_mc", a+30, {_x:0, _y:ypos});
if (num != mm_array.length) {
attachMovie("mask_mc", "mask"+a+"_mc", a+990, {_x:0, _y:0});
mask_mc = this["mask"+a+"_mc"];
mask_mc._alpha = 10;
mask_mc.onEnterFrame = function() {
this._height = _parent.container_mc["mainnav"+mm_array.length+"_mc"]._y;
};
this["subnav"+a+"_mc"].setMask(mask_mc);
}
nc = this["subnav"+a+"_mc"];
nc._alpha = 0;
nc.itemnum = a;
nc.menutext = eval(array)[(a-1)];
nc.alphaTo(100, 2);
nc.onRelease = function() {
// Function to get submenu actions needs to go here
var my_str:String = new String(this);
_root.select = "You have selected "+my_str.slice(18);
};
submenu_array.push("subnav"+a+"_mc");
a++;
}
}
// Build Menu -----------------------------------------------------------------------
_root.collapsed = true;
createMainMenu();
Can We Apply SetMask() With This?
I'm trying to apply a mask while loading my xml file but I can't make the mask working from right to left side.
Does anyone know how to apply a mask?
Here's my code:
var lexml = new XML();
var chemin = "../xml/";
var tab_images = new Array();
lexml.ignoreWhite = true;
lexml.onLoad = loaderXML;
lexml.load(chemin+"company2.xml");
// Permet de loader le fichier xml
function loaderXML(loaded) {
var racine = this.firstChild;
var nb_elements = racine.childNodes.length;
if (loaded) {
for(i=0;i<nb_elements;i++) {
var company_name = racine.childNodes[i].attributes;
var item = _root.attachMovie("company", "item"+i, i);
item.nom_txt.text = company_name.id;
item.nom_txt.autoSize = "center";
// Positionning space
var cote_gauche = _root["item"+(i-1)].nom_txt._x;
var profondeur_mc = _root["item"+(i-1)].nom_txt._width;
//trace("Item "+left_space+ " Width " +mc_width);
item.nom_txt._x = 0;
item.nom_txt._x = cote_gauche + profondeur_mc + 20;
item.nom_txt._y = 20;
//trace(item);
item.setMask(affecter_mask());
}
} else {
text_area.text = "Can NOT load the images request. Please make sure you have right path...";
}
}
function affecter_mask() {
var mask = _root.attachMovie("mask_area_mc","mask", this.getNextHighestDepth());
mask.onEnterFrame = function() {
this._x += 20;
};
}
Why Do I Delegate When I Can Apply?
What is the advantage of using a Delegate class in as2? I realize that it's old news for as3 guys. But Ive got a medium sized as2 project and Im going through my code and wondering why Im using Delegate.create sometimes. What's wrong with "apply"?
I admit that I must have jumped on the Delegate bandwagon without thinking anything more than "dhuu...thats what the pros must be using".
Am I right in saying that there is nothing at all wrong with simply saying "function_name.apply( this, args )"? Or am I missing something? Is it a matter of memory management? I've done a lot of research on delegation and read all kinds of blogs and scripts from little tweeks to the official.. to >200 lines. Yikes! At the end of the day I wrote my own little delegate class that worked for me (just a rewrite of Proxy without loops). But now that I go though my code I see that I might as well have just used apply because that's all Im doing with it!
Id like to be a better programmer. What am I missing and why shouldn't I do a find and replace here. Why is it better to wrap up "apply"? Will I be better readied to learn other languages? If thats it Im all for it. Could you tell me why?
I just don't understand why I was so convinced that I needed the delegate class when I had "apply" out of the box.
Thanks and I hope I didnt take up too much space here.
Function.apply()
Can somebody please detail for me what the first parameter in Function.apply() is used for? Whenever I try to use the method I get a stack overflow error and I'm not sure why I'm using it incorrectly. My code is fairly huge but I will explain it in a following post if this isn't a common error or there's a simple fix that I've overlooked.
Thanks
Function Apply
I ran into a problem with apply. I've always used delegate and delegate plus, and havent had to deal with apply directly.
The problem is when i try to add parameters to the function.
Code:
// adding one function to the que, with random parameters as an array
_aQueue.push({func:initMask, args:[_mcSummary]}, {func:tweenAll, args:["2", "3", "432"]});
trace(typeof(_aQueue[0].args)) // outputs ARRAY
trace(_aQueue[0].args) // outputs content of array
// apply the function
_aQueue[0].func.apply(this, _aQueue[4].args);
function initMask(whatever:Array):Void {
trace(whatever) // outputs the FIRST element that was in the array
trace(typeof(whatever)) outputs STRING if the first element is a string, outputs mc if the first element is an mc
}
Why do the parameter get ****ed up? I've checked the docs, and as far as i understod its supposed to be an ARRAY of parameters.
Any help appreciated!
|