Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Angle Of Reflection


Hey everyone! Been a long time since I've been here, sheesh, maybe a few years.

Anyway, since my days of flash I've moved to PHP and Pool/billiards. Since this isn't possible in PHP, wondering if someone would either give me a direction, or is up to the challenge/job, depending on your level. What I'm looking for is a virtual pool table, used for calculating angles of reflection when making kick shots (cue ball to a rail, then to object ball). One rail kicks are easy, but when it comes to 2 and 3 rail kicks, the angles become difficult to read and predict.

Let me know if you have an interest in helping with this!

Steve




FlashKit > Flash Help > Flash ActionScript
Posted on: 02-21-2006, 09:16 PM


View Complete Forum Thread with Replies

Sponsored Links:

How Can I Get Angle Of Reflection Inside Ellipse ?
How can I get angle of reflection inside ellipse ?
Hi . by your favor I'm English is very poor .

I want to get angle of reflection inside ellipse .
How can I get this ?

This is reference document

http://cage.rug.ac.be/~hs/billiards/billiards.html

http://forums.ultrashock.com/forums...e+of+reflection[/url]

http://cont112.edunet4u.net/~jin062.../JSP/EL002.HTML

This is my FLA (flash 8 ) file.

http://www.linuxstudy.pe.kr/~charmhoi/data/ellipse.fla

Thank you for your time.

View Replies !    View Related
Reflection
Does anyone know how to create a reflection in the water type effect?
Thanks

View Replies !    View Related
Reflection?
Is there any way that I can "reflect" the contents of a movie clip? I'm having something move around, but do not want to build a left AND right set up for animation. Is there any way to use only the left, and somehow flip horizontally all of the frames for right, with actionscript?

View Replies !    View Related
Using Reflection In AS3
Can we use reflection in AS3 as we use in c# reflection to get all methods and propertiest and running methods through it.. any guess or samples

View Replies !    View Related
Reflection
hi to all...

I am having this idea of making like a reflecting shadow of my site...just like the buttons in this page.....

http://www.btflhosting.com/

howebr i think it could be easy for me since i already have ma site formated like...
small swf loading into a big one....

so basically i can set the AS to the mother SWF....
so please can i get some help..or if anyone knows anyother ways!

thanks..
ROnnie!

View Replies !    View Related
Reflection Mc
if i have a mc how would i flip it vertically and have it fade out towards the bottom so it seems as if it were a reflection?

thanks!
austin

View Replies !    View Related
Help With A Reflection
I found the randome movement code somewhere, and tried making it work with an object and its reflection. Object moves fine, but since its reflection has the be mirrored in the y axis, it acts funny.... it makes the reflection keep rising and rising very slowly untill it goes behind the object.

the problem is because of the "-" on line *... but how else would i make it go in the oposite direction?

see the movie at http://babiy.net/reflect.html
it might not be obvious at first, but reflection VERY SLOWLY moves up and up untill it goes behind the bottle

code:

onClipEvent (load) {
width = 5
height = 5
accelFactor = Math.ceil(Math.random()*4) + 2;
newX = Math.round(Math.random()*width);
newY = Math.round(Math.random()*height);
}

onClipEvent (enterFrame) {
currentlocx = this._x;
currentlocy = this._y;
differencex = newX-currentlocx;
differencey = newY-currentlocy;
accelx = differencex/accelFactor;
accely = differencey/accelFactor;
this._x = this._x+accelx;
this._y = this._y+accely;
_parent.reflect._x = _parent.reflect._x+accelx;
*_parent.reflect._y = _parent.reflect._y-accely; _parent.shade._x = _parent.shade._x+accelx;
if (Math.round(this._y) == Math.round(newY) && Math.round(this._x) == Math.round(newX)) {
newX = Math.round(Math.random()*width);
newY = Math.round(Math.random()*height);
accelFactor = Math.ceil(Math.random()*4) + 2;
}
}


How do I get around the problem ?
TIA!

View Replies !    View Related
Reflection Help
So I am using Lee's great relfection class and I have it working on an image, but when i try to apply it to an MC that just has text in it, all I see is a gradient.

My registration is correct, I'm getting no errors, and I even have it being applied to the image at the same time, and it still works, but just doesn't seem to work with the text.

I even went so far as to convert the text to a graphic inside flash...still nothing but an ugly gradient, can anyone help me here?

View Replies !    View Related
Reflection On/Off
Hi,

I have managed to get the reflection class to work with Flv's - what I would like to do is using a checkbox - give the option to the user to turn it on/off (it looks great for some videos just not all).

As I understand it the drawIt method needs to be called on the EnterFrame...I have tried putting a If statement around this to reflect (no pun intended) the status of my checkbox - but although it works on the first click it does not work on any following:

Code:


// the checkbox default is true so variable is set to reflect.

var ref:Reflection = new Reflection(vid,150,255);

[..]

reflection = new Object();

reflection.click = function(eventObj) {
// this works on the first click of the checkbox - and the reflection
// 'disapears' but if it is checked again to set to true nothing happens.
   if (reflect.selected == true) {
      var ref:Reflection = new Reflection(vid,150,255);
   } else {
      var ref:Reflection = new Reflection(vid,0,0);
   }
}

this.onEnterFrame = function() {

      ref.drawIt();
    }

reflect.addEventListener("click",reflection);



Is there not an easier way to do this?

TIA

Pete

View Replies !    View Related
Dynamic Reflection
I'm trying to create a "reflection" effect on a menu I've designed, which is a copy of it flipped vertically upside down with an alpha of 5%.

My problem is that when the user hovers over the real menu, the copy doesn't react. Is there an easy scripting work around?

Listener maybe? Some way to dynamically tell it to mimic the real menu???

Thanks guys/gals.

View Replies !    View Related
Water Reflection.
Hello all,
This is my first post.
I have been on the internet all day searching and trying to find a tutorial that will show me how to make a water ripple reflection effect in Flash. Does anyone have any links to tutorials and/or pages on how to do this.
All help is greatly appreciated
J

View Replies !    View Related
Reflection As In A Bubble
Anybody know what's the best (and easiest) way to create a nice little glowy shiny reflection?

View Replies !    View Related
Animated Reflection
I need to make an animated button. It needs to look like it has a sheen on it or like a reflection. I've seen this sort of thing before but can remember what it looks like. any help would be appreciated.

View Replies !    View Related
Angular Reflection
I am working on ballpop game in which the ball should be reflected after hitting some base, till now the movement ball is straight using hitball._y++ but i want it to be angular based on the angle it hit to the base

anyone please help

View Replies !    View Related
Reflection In Y-axis
I'm trying on an exercise that need to check whether the new position of an image is correctly reflect in the y-axis.

The basically of this exercise is:
Let say there is an object (a dot) at coordinate (2,3). When I click at a new position, a new image of the original object will be flipped at the new position there. So in order to check whether the flipping object is correctly reflected in y-axis, what should be done? Hope someone could help me out. Thanks in advance.

View Replies !    View Related
MouseCursor's Reflection
hey wasup...

how do u get the image of the current active mouse cursor?... i know how to trace mouse movements and reflect the cursor if i have the active cursor being used. if any1 has reflected the mouse cursor before and if you have any ideas, please reply as soon as u can ....

View Replies !    View Related
Image Reflection
Hi, is anyone able to direct me to any tutorials which show you how to create a subtle image reflection? I want something like the reflections used in the menu of this web site http://www.tinselvision.com/

Thanks

View Replies !    View Related
Reflection Of A MovieClip
Dear All,

I found a Reflection of a movieclip use full thread here

http://www.flashdevils.com/showthrea...&postid=195528

Regards,
Nalini

View Replies !    View Related
Tile Reflection
Hi all

Im building a new website, which follows the actual design trends, such as the reflection of the objects.

In this case, i have simple panels, which slide up and down and appear to be on some type of floor, which reflects them.

Since the content on those panels is dynamic, like text and images and they have animations (rollovers and stuff), the reflection should be dynamic as well.

I figured out a simple way to do it using bitmap data, but its really heavy on the cpu.
I think its because of the transparency on the bitmapData object, but i need it. Otherwise one of the reflexes will be on top of the other.

My code is:


Code:
import flash.display.BitmapData;

onEnterFrame = function () {
frontBmp.dispose();
var frontBmp = new BitmapData(995, 592, true, 0);
frontBmp.draw(front);
frontReflex.attachBitmap(frontBmp, 1, "auto", false);

backBmp.dispose();
var backBmp = new BitmapData(995, 592, true, 0);
backBmp.draw(back);
backReflex.attachBitmap(backBmp, 1, "auto", false);
};
Explanation:

the Front mc is a movieclip that has some front panels, which reflect a bit further down than the back ones, to give the perception of depth.

i have a frontReflex mc and a backReflex mc, which are rotated 180š and positioned so they will create the "floor" where i want them.

As you can see on this image: http://www.andreassalino.com/testing/homepage_guide.jpg

Does anyone have a better suggestion to achieve the same result, but without the cpu problem?

I thought of using only one mc to receive both of the bitmap data, in different coordinates. That way i wouldnt need the transparency.

What do you think?

Thanks in advance

View Replies !    View Related
Reflection Class
i am using reflection class created by ben
http://www.adobe.com/devnet/flash/ar...class_as3.html




ActionScript Code:
import com.pixelfumes.reflect.*;
import flash.display.MovieClip;
var spr:MovieClip=new MovieClip();
with (spr) {
    graphics.beginFill(0xFF0000);
    graphics.drawRect(100,100,300,100);
    graphics.endFill();
    name="mc1";
}
addChild(spr);

var r1:Reflect = new Reflect({mc:spr, alpha:50, ratio:50,distance:0, updateTime:0, reflectionDropoff:1});


my problem is how to dynamically created object pass instance name to that class

View Replies !    View Related
Using Reflection Class
HI all,

i am using reflection class from here
http://www.adobe.com/devnet/flash/ar...class_as3.html


i want to reflect papervision 3d plane..


ActionScript Code:
import com.pixelfumes.reflect.*;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.materials.*;
var container:MovieClip=new MovieClip();
container.x=stage.stageWidth*0.5;
container.y=stage.stageHeight*0.5;
container.name="mc1";
addChild(container);
this.frameRate=40;

var scene:Scene3D=new MovieScene3D(container);

var camera:Camera3D=new Camera3D();

camera.zoom=10;
//star making planes...
//create material-by attaching bitmap using BitmapAssetMaterial
var bam:BitmapAssetMaterial=new BitmapAssetMaterial("FlashIcon");
//by default material applied to one side of object(here plane);
bam.oneSide=false;
bam.smooth=true;
for (var i:int=0; i<1; i++) {
    //new Plane(material,height, width,triangle num,triangle num)---triangle num to control quality
    var p:Plane=new Plane(bam,150,75,2,2);

    p.x=50*i;
    p.y=40;
    p.z=40*i;

    p.rotationY=45;

    scene.addChild(p);
    var container2:Sprite = p.container;
var r2:Reflect = new Reflect({mc:p.container , alpha:50, ratio:100,distance:0, updateTime:0, reflectionDropoff:1});
}
scene.renderCamera(camera);
var mc1:Sprite = getChildByName("mc1") as Sprite;
var r1:Reflect = new Reflect({mc:mc1 , alpha:50, ratio:100,distance:0, updateTime:0, reflectionDropoff:1});
this.addEventListener(Event.ENTER_FRAME,render);
function render(e:Event) {

    scene.renderCamera(camera);
}

thanks in advance...

View Replies !    View Related
BitmapData Reflection
Hi to all,
i need apply a reflection to a BitmapData.

I look on the web and here as well but most of the source i found they apply the reflection to a DisplayObject and add to the stage the reflection part.

My case is different:
I have a BitmapData 320x240 (webcam snapshot) so i need to apply the reflection inside this BitmapData.
Shortly i need to apply the reflection starting from 3/4 of the Height (180px) until to the end.
But i need to return the BitmapData (from a function) with the reflection embed inside.

I tried a lot but i am not so good with image processing.

I attach a image to explain better because my english is not so good.
Help, suggestion, and code are really welcome.

Thank to ALL in advance

View Replies !    View Related
Creating A Reflection Of FLV
Hi!

I am trying to create a reflection of a video in real time like on Nike
(USA's) website. They have a video playing and you can see clearly the
reflection below.

I am wondering what would be the best way to accomplish the effect?
I know I can create the video directly with a reflection and encode it in
Flash but I am wondering if there is anyway I can just take the video and
create a symbol of it and have it play in sync? I have tried doing that
previously but the video and the reflection of it do not sync. Any
suggestions out there?

Thank you.


°K.

View Replies !    View Related
Reflection For Xy Plane
Dear All,
Need help for the following areas in action script
1. Reflection about any line
2. Reflection about y=mx+b

Thanks in advance.

Regards,
tthiya





























Edited: 07/12/2008 at 12:49:13 AM by tthiya

View Replies !    View Related
Water Reflection
hey ho, ive made a website logo (in flash) as an enter page image but i fancy making a water reflection of this image, ive seen this done before can anyone help?

-Kip

View Replies !    View Related
Reflection / Deflection
I am very curious about using physics concepts in Flash, and I want to try to create a realistic billiards type situation. I didn't place this in the Games section because the information isn't specific to the game, I am talking about the Law of Reflection. To clarify, I'm talking about 2D collision behavior; when one ball hits another, at what angle does it reflect / deflect off?

I can calculate angles and reflections pretty easy by hand, on paper, with vector and ray diagrams, but I'm kind of confused as to how to get that concept on the computer. I know this can be done, from playing Flash billards games online.

I'm really looking for answers from someone who knows their math in this area, like sen or Voets maybe Thanks ^_^

View Replies !    View Related
Lightening And Reflection
Hi !
So, how do I create Lightening and Reflections in Flash ? the ones that we see in 3D Softwares. like where the light is coming from (i.e. direction) and stuff.

Thanks

View Replies !    View Related
Reflection In Y-axis
I'm trying on an exercise that need to check whether the new position of an image is correctly reflect in the y-axis.

The basically of this exercise is:
Let say there is an object (a dot) at coordinate (2,3). When I click at a new position, a new image of the original object will be flipped at the new position there. So in order to check whether the flipping object is correctly reflected in y-axis, what should be done? Hope someone could help me out. Thanks in advance.

View Replies !    View Related
Method Reflection
I'm working on a simple logging tool for Flash and I'm wondering how I could return the method name that it's logging from. Umm...


Code:
public function MyTestFunction()
{
LOG.Info("Logging this function: " + <Get_Function_Name_Here>);

trace("mytestfunction");
}

So that would fire off to my LOG utility the message string "Logging this function: MyTestFunction".


Know if this is possible?

Oh fyi, using Actionscript 2. I'm pretty sure it's in 3, but not applicable for me right now.

Mucho thanks. =]

View Replies !    View Related
Reflection Trick Using AS3 ?
It used to be relatively simple to make a reflection using the setMask() but ActionScript 3.0 has changed that...

I would love a tutorial to be able to do the reflection once again.

View Replies !    View Related
Making Reflection
hey guys, do anyone knows how to create a reflection for a movie clip?
i'm thinking duplicating it and lower it's alpha, but i can't seem to rotate it right using AS,
anyone have any idea how the script goes?

help is needed, thankssss

View Replies !    View Related
Button Reflection
Hey!

I was wondering if somebody could tell me how should the reflection of this pill work. When the ball goes up something should happen to the reflection, but i am not sure what.
Should it fade or maybe grow smaller...donīt know what
Could somebody thatīs maybe an "expert" tell me please


Thank you.


regards: Daisy

View Replies !    View Related
Reflection Effect
how to make reflection effect for movieclip?

View Replies !    View Related
Water Reflection
hey ho, ive made a website logo (in flash) as an enter page image but i fancy making a water reflection of this image, ive seen this done before can anyone help?

-Kip

View Replies !    View Related
Reflection / Deflection
I am very curious about using physics concepts in Flash, and I want to try to create a realistic billiards type situation. I didn't place this in the Games section because the information isn't specific to the game, I am talking about the Law of Reflection. To clarify, I'm talking about 2D collision behavior; when one ball hits another, at what angle does it reflect / deflect off?

I can calculate angles and reflections pretty easy by hand, on paper, with vector and ray diagrams, but I'm kind of confused as to how to get that concept on the computer. I know this can be done, from playing Flash billards games online.

I'm really looking for answers from someone who knows their math in this area, like sen or Voets maybe Thanks ^_^

View Replies !    View Related
Lightening And Reflection
Hi !
So, how do I create Lightening and Reflections in Flash ? the ones that we see in 3D Softwares. like where the light is coming from (i.e. direction) and stuff.

Thanks

View Replies !    View Related
Help On Reflection Class 2.0
Hi all
What is Reflection Class 2.0 and how to use?
Could someone please givme an intro to it?
have found following code from following link
http://pixelfumes.blogspot.com/2005/...-download.html


ActionScript Code:
//create a Net Connection and Stream
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
myVideo_mc.myVideo_video.attachVideo(stream_ns);
 
//select an external FLV to play
stream_ns.play("nutrigrain.flv");
 
//create an instance of the class
//pass the mc to reflect, the opacity of the reflection, the ratio of the gradient mask, and how often to update (milliseconds)
reflect = new Reflect(myVideo_mc, 50, 255, 5);
 
The Class:
 
import flash.display.BitmapData;
 
class Reflect {
 
//Ben Pritchard 2005
 
//Pixelfumes.com
 
private var version:String = "2.0";
 
private var mcBMP:BitmapData;
 
private var reflectionBMP:BitmapData;
 
private var updateInt:Number;
 
 
 
function Reflect(mc:MovieClip, alpha:Number, ratio:Number, updateTime:Number) {
 
//create a bmp obj out of it
 
mcBMP = new BitmapData(mc._width, mc._height, true, 0xFFFFFF);
 
mcBMP.draw(mc);
 
reflectionBMP = new BitmapData(mc._width, mc._height, true, 0xFFFFFF);
 
reflectionBMP.draw(mc);
 
mc.createEmptyMovieClip("reflection_mc", mc.getNextHighestDepth());
 
mc.reflection_mc.attachBitmap(mcBMP, 1);
 
mc.reflection_mc._yscale = -100;
 
mc.reflection_mc._y = mc._height;
 
 
 
//create the gradient mask
 
mc.createEmptyMovieClip("gradientMask_mc", mc.getNextHighestDepth());
 
var fillType:String = "linear";
 
var colors:Array = [0xFFFFFF, 0xFFFFFF];
 
var alphas:Array = [alpha, 0];
 
var ratios:Array = [0, ratio];
 
var matrix = {matrixType:"box", x:0, y:0, w:mc._width, h:mc._height/4, r:(90/180)*Math.PI};
 
var spreadMethod:String = "pad";
 
mc.gradientMask_mc.beginGradientFill(fillType, colors, alphas, ratios, matrix, spreadMethod);
 
mc.gradientMask_mc.moveTo(0, 0);
 
mc.gradientMask_mc.lineTo(0, mc._height/2);
 
mc.gradientMask_mc.lineTo(mc._width, mc._height/2);
 
mc.gradientMask_mc.lineTo(mc._width, 0);
 
mc.gradientMask_mc.lineTo(0, 0);
 
mc.gradientMask_mc.endFill();
 
mc.gradientMask_mc._y = mc._height/2;
 
mc.reflection_mc.cacheAsBitmap = true;
 
mc.gradientMask_mc.cacheAsBitmap = true;
 
mc.reflection_mc.setMask(mc.gradientMask_mc);
 
updateInt = setInterval(this, "update", updateTime, mc);
 
 
}
 
private function update(mc):Void{
 
mcBMP.draw(mc);
 
reflectionBMP.draw(mc);
 
mc.reflection_mc.attachBitmap(mcBMP, 1);
 
}
 
}

View Replies !    View Related
Reflection Effect
Im designing a website with a layout similar to:

http://www.xscapeproductions.com/title/
http://www.shakedown-ent.com/

What i want to know is what is the best way to the the reflection effect at the "floor" (the blue one on the first site)

Is there any way to make an automatic effect or will i have to draw a shadow and apply a mask to it?

any ideas please?

View Replies !    View Related
Reflection Effect
I wonder how do they make that reflection effects of the buttons, do they use AfterEffects?
on the site:www.howblue.com

does someone knows a tutorial about it?

View Replies !    View Related
Flash Reflection
Hello,
I am curious if someone could give me a hand or point me in the right direction on how to achieve an animated reflection.

I have a content box with a button that has a reflection of the box/button below it. The content box is going to be a rollover and I am trying to figure out how to make the reflection show the rollover when the main content box is moused over.

Any help would be greatly appreciated.













Attached Images

View Replies !    View Related
Reflection With Transparency?
Apologies for a novice question, but I'm only now getting into Flash.

In regards to the 'reflection' effect, it is possible to get a reflection while using a colorful background?

From the little I understand, a gradient mask is required to get the reflection effect. This gradient mask apparently has to be a fixed color (although I saw some kinda rainbow color option, didn't help either) which conflicts with any differently colored background.

So if I use a black gradient mask against a black background, all is well.
If I use black gradient against blue background, the mask area shows up in black. Of course that is easy to solve by changing to a blue gradient.
But if I have a picture as the background, there seems to be no way to make that gradient mask just do it's job of creating a reflection without being noticed.
Is there any fairly simple way of accomplishing this?

View Replies !    View Related
Carousel Reflection Help?
Hey guys, its me again.
I just made it through the Carousel 1 tutorial but with one problem. When I increase the numOfItems to more than 1, my reflection goes nutz. It doesn't work on most of the icons and some just don't show up at all. Hope that makes sense.

feel free to check out the file.
[url]http://www.rideshotgun.net/tommy.zip

thanks in advance.[/url]

View Replies !    View Related
AS3 Reflection Class
Just happened upon this handy AS3 reflection class -
http://www.afcomponents.com/blog/?p=123

View Replies !    View Related
Reflection Class
Hi guys, I am using a reflection class I have found it on the adobe.com site:http://www.adobe.com/devnet/flash/articles/reflect_class_as3.html I am using it to add relections to my thumbnails in the glallery, everythink is fine but when I add more photos then around 30 it gets messy... Just check it out http://www.dgphoto.eu/as3/main.html to see gallery you have to click in the second column the "Fotografia Slubna" directory I am adding the reflection to every thumbnail, any ideas on how can I solve my problem?

View Replies !    View Related
Random Motion With Reflection
Hi, I am trying to have an object float around in a random motion, with a reflection.

I found the randome movement code somewhere, and tried making it work with the reflection. It works on the x, but not y ... it makes the reflection keep rising and rising untill it goes behind the object.

Please tell me what im doing wrong, TIA

onClipEvent (load) {
width = 5
height = 5
accelFactor = Math.ceil(Math.random()*4) + 2;
newX = Math.round(Math.random()*width);
newY = Math.round(Math.random()*height);
}

onClipEvent (enterFrame) {
currentlocx = this._x;
currentlocy = this._y;
differencex = newX-currentlocx;
differencey = newY-currentlocy;
accelx = differencex/accelFactor;
accely = differencey/accelFactor;
this._x = this._x+accelx;
this._y = this._y+accely;
_parent.reflect._x = _parent.reflect._x+accelx;
_parent.reflect._y = _parent.reflect._y-accely;
if (Math.round(this._y) == Math.round(newY) && Math.round(this._x) == Math.round(newX)) {
newX = Math.round(Math.random()*width);
newY = Math.round(Math.random()*height);
accelFactor = Math.ceil(Math.random()*4) + 2;
}
}

View Replies !    View Related
Flashy Reflection Effects
I'd like to create the same flashy effect on my logo, as the passing reflection on
http://www.templatemonster.com/show....g2=&order=date or http://www.templatemonster.com/show....2=&order=date.
My logo is composed by two surrounding eliptical circles, one orange and the other blue.

I'd like to create that effect on both eliptical circles, and therefore i am asking for your help.

You can see the logo at http://www.motonline.pt/logo.jpg or this one (3D like)
http://www.motonline.pt/logo_teste.jpg.

How do i do it??? Any help from you would be extremely appreciated.

Thanks in advance

View Replies !    View Related
Object Reflection In ActionScript 2 ?
Is there a way to view all the properties of one Object in ActionScript 2 or 1. Something like

print_r($obj)

in PHP or Reflection classes in Java?

Thank you

View Replies !    View Related
Question About Reflection Of A Photograph
Hello...I am thinking this must be pretty easy. I have a photograph that I want to have a reflection of it below the photograph, but I want the reflection part to look like it's fading...like a linear fade from top to bottom...70% alpha to 0% alpha. Is this possible in flash....version MX.

View Replies !    View Related
Hard As2 Reflection Question?
hi, is there a way to get the name of the function CURRENTLY ASSIGNED TO some variable? is there something loke as2 reflection?
i have to fuctions setOnRelease and getOnRelease.
i use setOnRelease(passing it some function name) to set the onRelease Handler and that works. But what i want to do is also get the Function name by calling getOnRelease().
see following code : how should i change my getOnRelease code to trace the current function name assigned to onRelease?
(the Class design is temporary, i wont to dynamicly(on the runtime)change my handler based on the actuall handler name)

import de.mediaholic.*;
class de.mediaholic.Avatar extends MovieClip {
public static var HAPPY:Number = 0;
public static var SAD:Number = 10;
public static var NEXT_STATE:Number = HAPPY;
public function init(x:Number, y:Number):Void {
setState();
setOnRelease(setState);
this._x = x;
this._y = y;
getOnRelease();
}
public function setOnRelease(func:Function):Void {
this.onRelease = func;
}
public function getOnRelease():Function {
//HOW To GET THE NAME OF THE FUNCTION CURRENTLY ASSIGNED TO onRelease
trace(this.onRelease._name);
return this.onRelease;
}
public function setState():Void {
switch (Avatar.NEXT_STATE) {
case Avatar.HAPPY :
Avatar.NEXT_STATE = Avatar.SAD;
this.gotoAndStop("HAPPY");
break;
case Avatar.SAD :
Avatar.NEXT_STATE = Avatar.HAPPY;
this.gotoAndStop("SAD");
break;
}
}
//no const. instead static creational method
public static function main(name:String, target:MovieClip, depth:Number, x:Number, y:Number):Avatar {
var av:Avatar = Avatar(target.attachMovie("AvatarSymbol", name, depth));
av.init(x, y);
return av;
}
}

View Replies !    View Related
Transparent Reflection Problem
Does this ever happen to you? Sometimes you come up against a problem that seems to have a simple solution, but for the LIFE of ya, you can't figure out what that solution is!

Here is the deal. I am creating a site in flash to display an artist's work. We are using a slideshow with thumbnails to display the different works. We decided that we wanted to add a little "Apple-esque" reflection to the images when they display in the "content" area. One little problem . . . the background of is constantly in motion . . . so we wanted to make sure the background could be seen through the transparent reflection . . .

We started with the files in PNG to preserve the transparencies . . . they were far too large. Then we tried using gifs . . . not only did the primary image look like crap, but the reflection because all pixilated and did not look good . . . so then I thought, we can flip the image vertically and use flash. I created a gradient with alpha levels that did a good job . . . but in order for the everything to work correctly I had to specify a color to "un-alpha" . . . this means that behind the reflection, you can't see the moving background . . . In other words . . . the movie clip into which the flipped image is loaded is not transparent . . . does this make sense to anyone? Has anyone done the "reflection" before with any success in having a viewable background? And am I making this clear, cause reading over this post, it sure doesn't sound that clear!

View Replies !    View Related
[F8] Shape Reflection For Quadrants
Hello everyone
it needs a great calculation.I am working on a project where user will make a shape in one quadrant of graph and we have to make its reflection on the other quadrants .but the reflection should be at the same dis from x,y axis.


Can anybody help Pleeezzzzzzz.

View Replies !    View Related
Copyright Đ 2005-08 www.BigResource.com, All rights reserved