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




Finding Where You Mouse Is In Relation To An MC



I'd like to be able to find out where my mouse pointer is in relation a a movieclip and translate this in degrees. The catch is I need the center of the clip. Attached is a diagram as to what i mean. Please let me knwo if you need me to explain it better.

Setup:
circle_mc (on main timeline)



ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 10-25-2007, 06:05 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Finding Out _x, _y In Relation To Stage Not Parent Movie
How do I find out the co-ords of a movie relative to the stage not it's parent movieclip?

any ideas?
Thanks in advance,
George.

BG Scrolling In Relation To Mouse Coordinates
Hi all!...

I'm making a site where I want the background image to pan/scroll in relation to the mouse placement. As in...if the mouse moves to the bottom left corner of the stage, the "camera" pans down to the bottom left corner of the BG image (thus technically the BG image pans to the up right). Additionally, I want the BG image to ease as it pans. I've been searching the forums for about 2 hours looking for something relating to this and I can't find a thing!
I know I need a mouse listener, but from there I don't know where to go...I really new to Actionscript, so I really appreciate your help!

Thanks so much!!!

An example of what I want can be found at:
http://www.karlaweb.tk/
by clicking on "entrar a disfrutar" and then clicking on "Experimental."

Track Mouse In Relation To A Specific MC
I'm trying to build a button that controls the movement of a movieclip. I want the _xmouse position in relation to the button to determine the speed at which the movieclip moves. How do I track the position of the mouse in relation to a specific movieclip and relay this information back to the move function?

Easing While Moving Something In Relation To Mouse?
Hey guys. I have a stack of images that I need to move down when the mouse is above y = 250 and up when the mouse is below y = 250. I have this code, but the problem is I don't know how to add easing. Can anyone pose a solution? Thanks



ActionScript Code:
onEnterFrame = function() {    someConstant = 2342;    lastIndex = picThumbArray.length - 1;    lastImage = imageStack_mc["picContainer"+lastIndex];    firstImage = imageStack_mc.picContainer0;    if (_xmouse > 750 && _xmouse < 950) {        if (_ymouse < 250) {            if (imageStack_mc._y < 45) {                imageStack_mc._y += 2;                //imageStack_mc._y = (45 - imageStack_mc._y) / someConstant;            }        } else {            if (imageStack_mc._y > (540 - (83 * picThumbArray.length + 75))) {                imageStack_mc._y -= 2;            }        }    }}


p.s. that one line thats commented out, this one: //imageStack_mc._y = (45 - imageStack_mc._y) / someConstant; is my attempt at easing , but that code just makes it zoom instantly to 45. wierd.

Mouse Position In Relation To Main Time Line
Hi
How would i convert the x and y coordinates of a movie clip from its local values ( ie. in relation to the movie clip its sitting in) to values in relation to the main movie timeline.

I have used this function before but cant remmeber it..

Movie Clip Moves In Relation To Mouse Position
Hi.

I'm a beginner using Flash MX - I found this link;

http://www.ecosign.net/html/__de/arbeiten/arbeiten.php


and would like to do something similar. I thought it would be fairly easy but I've been trying to do it all afternoon but I can't seem to manage. I'm going insane. Can someone please tell me how it is done?

Thanks.

Setting Alpha (brightness) Property In Relation To Mouse X,y Coordinates.
I know this is somewhat simple and I've seen the tutorial before but can't seem to find it when I need it

I have a MC (instance name "footer") that I would like to change the alpha (or brightness) as the mouse nears it. For example, while the mouse is 200 pixels away, the MC's alpha is set to 20%. As the mouse nears the MC, I would like the alpha to adjust according to the mouse's position--making the MC fade in more and more... So when the mouse is right over top of it, the MC's alpha is 100%.

If someone could point me in the right direction.....

Thanks
Schimke

Help Needed With Some Flash8 AS - Rotation Of Movieclip In Relation To Mouse On Stage
Ok, I'll try to keep this fairly simple...

a) I want to create something similar to the menu that is dominant on this website :
http://www.satyricon.no/

though it used to be a bit cooler, with that it used to rotate backwards/depending on where the mouse was in relation to it... I'd like to figure out how its done/be able to implement a similar kind of thing in a flash folio I am slowly making/figuring out ideas for....

Ive been tinkering with other ideas, which are here:
http://members.westnet.com.au/alex66/

Very taken with the idea of creating kind of "orbiting" elements/having interaction in that sense and creating a feeling of "Depth" as well through the use of scale..

Anyhow - the "main" topic of my request here is - to get some help with the Actionscript that I have currently got, which is a horrible mish-mash of code off some of the Kirupa tutes... I am still learning Flash, and Im sure there is still a long long way to go

It's very close to doing what I want it to do, but, Im not sure/have no idea what the missing "element" is that is eluding me
If possible I'd like to be able to "limit" the "speed" of the rotation when the user gets too "close" to the menu, so it doesnt go into hyper speed and become unuseable, and also, not have it ever really truly stop - I guess maybe some easing or something ?

Anyhow, the url for the files is:
http://members.westnet.com.au/alex66/rotation.html [to view/preview it]
http://members.westnet.com.au/alex66/rotation.fla [the Flash 8 .fla]

Ive "commented" the .fla so it should be fairly easy to understand

All and any help really appreciated! I know this is kind of a "really simple" thing, but I've spent hours searching around google and such and trying different things and havent been able to sus it out yet

Regards from "down under" !
A.

Finding The X And Y Of The Mouse
i know this is super basic knowledge but could someone help me find the x and y the mouse on move? i'm not sure how to display the information received. thanks

Finding Mouse Right Click Event
Hi,
I need find out the Right Click mouse button Event.
I using some script its work only on windows System. I need it work Linux system also.
Pls help me
Reagrds
John.W.Berry

************************************************** *****
I am using following ScriptIts work window very fine but not a linux)
************************************************** *****
Mouse.rightMouseDown = false;
checkForChangeInMouse = function () {
if (Mouse.rightMouseDown ^ (Mouse.rightMouseDown=Key.isDown(2))) {
if (Mouse.rightMouseDown) {
Mouse.broadcastMessage("onRightMouseDown");
} else {
Mouse.broadcastMessage("onRightMouseUp");
}
}
};
setInterval(checkForChangeInMouse, 1);
Mouse.addListener(this);
this.onRightMouseDown = function() {
trace("Right Down");
};
this.onRightMouseUp = function() {
trace("Right Up");

};

Finding Movie Clip Instance Under The Mouse
I believe the answer to this question to be quite simple but have spent too much time trying to find an answer. I have just started to use Flash some 3 weeks ago, so am a novice.

I am building a chess game and would like to drag and drop chessmen across the chessboard. The board and pieces and built from movie clips at runtime (with help from the tutorial at Tonypa's website).

I can drag and drop Named instances only like:
code: onClipEvent (mouseDown){
_root.chessboard.m_1_7.startDrag();
}

but I am unable to move the piece under the mouse.
I have searched this forum and got code to find the name of the movie clip under the mouse but it only goes 1 deep for some reason. I think it maybe because the chesspieces movie clips are held themselves within the chessboard movie clip.
This is what I get.

_level0.chessboard
but I need to find...
_level0.chessboard.m_1_1
(chess men are named m_1_1 to m_8_8 corresponding to their starting positions)

the code that I found on these forums to find "_level0.chessboard" is ...
code: Object.prototype.mouseInstance = null ;
MovieClip.prototype.onRollOver = MovieClip.prototype.onDragOver = function(){
Object.prototype.mouseInstance = this;
}
MovieClip.prototype.onRollOut = MovieClip.prototype.onDragOut = function(){
Object.prototype.mouseInstance = null;
}

}
updateDisplay = function(id, oldVal, newVal){
display.field.text = id + ": " + newVal;
return newVal;
}
Object.prototype.watch("mouseInstance", updateDisplay);
updateDisplay("mouseInstance", null, null);

Is someone able to help get the drag and drop working?
I would like to be able to find the chessmen movie clip instance name so I can manipulate them.

thank you
John

For your information here is the code to generate the board and chessmen.

code:
fscommand("allowscale", false);
// our board is 2-dimensional array
// the chessmen are held in a 2-dimensional array
myBoard = [
[0, 1, 0, 1, 0, 1, 0, 1],
[1, 0, 1, 0, 1, 0, 1, 0],
[0, 1, 0, 1, 0, 1, 0, 1],
[1, 0, 1, 0, 1, 0, 1, 0],
[0, 1, 0, 1, 0, 1, 0, 1],
[1, 0, 1, 0, 1, 0, 1, 0],
[0, 1, 0, 1, 0, 1, 0, 1],
[1, 0, 1, 0, 1, 0, 1, 0]
];
myChessmen = [
[14,10,13,15,11,13,10,14],
[9, 9, 9, 9, 9, 9, 9, 9],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[1, 1, 1, 1, 1, 1, 1, 1],
[6, 2, 5, 7, 3, 5, 2, 6]
];




// declare game object that holds info
game = {tileW:32, tileH:32};
// Tile0 is light square, Tile1 is dark square
game.Tile0 = function () { };
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile1 = function () { };
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;

game.man1 = function () { };
game.man1.prototype.walkable = true;
game.man1.prototype.frame = 1;
game.man2 = function () { };
game.man2.prototype.frame = 2;
game.man3 = function () { };
game.man3.prototype.frame = 3;
game.man5 = function () { };
game.man5.prototype.frame = 5;
game.man6 = function () { };
game.man6.prototype.frame = 6;
game.man7 = function () { };
game.man7.prototype.frame = 7;
game.man9 = function () { };
game.man9.prototype.frame = 9;
game.man10 = function () { };
game.man10.prototype.frame = 10;
game.man11 = function () { };
game.man11.prototype.frame = 11;
game.man13 = function () { };
game.man13.prototype.frame = 13;
game.man14 = function () { };
game.man14.prototype.frame = 14;
game.man15 = function () { };
game.man15.prototype.frame = 15;

// building the world
function buildGame(board, men) {
// attach mouse cursor to highlight chessboard square
_root.attachMovie("mouse","mouse",2);
_root.mouse._x=20;
_root.mouse._y=4;
//_root.mouse.gotoAndStop(1);

// attach empty mc to hold all the tiles and chessmen
_root.attachMovie("empty","chessboard",++d);
_root.chessboard._x=20;
_root.chessboard._y=4;
// declare clip in the game object
game.clip = _root.chessboard;
// get board dimensions
var boardWidth = board[0].length;
var boardHeight = board.length;
// loop to place tiles on stage
for (var i = 0; i<boardHeight; ++i) {
for (var j = 0; j<boardWidth; ++j) {
// name of new tile
var name = "t_"+i+"_"+j;
// make new tile object in the game
game[name] = new game["Tile"+board[i][j]]();
// attach tile mc and place it
game.clip.attachMovie("tiles2", name, i*100+j*2);
game.clip[name]._x = (j*game.tileW);
game.clip[name]._y = (i*game.tileH);
// send tile mc to correct frame
game.clip[name].gotoAndStop(game[name].frame);

// and similarly for the chessmen
if(men[i][j] != 0){
var name = "m_"+(i+1)+"_"+(j+1);
game[name] = new game["man"+men[i][j]]();
game.clip.attachMovie("chessmen", name, i*1000+j*2+1000);
game.clip[name]._x = (j*game.tileW);
game.clip[name]._y = (i*game.tileH);
game.clip[name].gotoAndStop(game[name].frame);
}
}
}
}

// build chessboard and place chessmen
buildGame(myBoard, myChessmen);

[as] MCs In MC In MC, _x And _y Relation To Root
The problem:

I have a MC, let's call it box3_mc, that's inside of box2_mc, that's inside of box1_mc. All the boxes (mc's) are placed on random _x and _y.

Now, what I want to do is determin the distance between box3_mc, and the top of the stage.

This could be done by just adding the distances:

distance = box1_mc._x + box2_mc._x + box3_mc._x;


The Challenge:

But let´s say box1_mc doesn't have an instance name, is there any other way to determine the distance between box3_mc and the top of the stage?

Check Where 1 Clip Is In Relation To Another
I have a cops n robbers type game on the go and i have hit a problem.
I need the cop to stop and look around him

The game is over when the cop hits the robber, so that is just a hit test, but each cop has a random sight distance.
I want to be able to check if the robber is in the radius of sight (so draw an imaginary circel and check if robber is in it) and if robber is in it then change direction towards the robber
any ideas?

Play Mp3 Without Any Relation To Frames
i need help......
i am using flash mx . i was in the work of creating an autorun for a personal cd of mine.... A problem came through. i need to play an mp3 file without importing it in to the frames. i have to do it with action script.
it must be like this when clicking oa button, the mp3 file should play on next click it shuold stop
pls help me....

[F8] Tweening In Relation To An Object
I have read how to use the tweening class, but how would I tween an object to move and stop 20px above another object? thanks
Dan

Rotation Of A Mc In Relation To A Point
Hello!
This is my first post on actionscript.org
I'm working on a thing that needs to rotate according to a position of another mc. Like an arrow pointing at something.

I'm working with atan2 with this code


Code:
onClipEvent (enterFrame) {

delta_x = this._x - _root.mc._x;
delta_y = this._y - _root.mc._y;

this._rotation = (Math.atan2(delta_x,delta_y) * (180 / Math.PI));
// * 180/ Math.PI to convert in degrees

}
I know that you know this one....

thanks

Dials Rotating In Relation To One Another
hi again.

i have been playing around with a draggable circle. and have craeted this fla file.
When you rotate the small circle the larger circle rotates in relation to it.
i think it works pretty well, its gonna be an interface for a website.
My only problem is that when i drag the central ring past nine oclock from twelve oclock the circle stops and changes direction.

i realise why this is doing it because the value jumps from minus to plus, but can anybody think of a way around this so that it is smooth without jumping.
I thought i would throw it out there for everybody, any help would be greatly appreciated

Thanks

michael

Speed In Relation To Distance...
Hi,

Is there a way i can make a movieclip speed up or slow down according to the distance between the mouse and the movieclip? I've made a friction effect for a movie clip (script 1) and i have a script to work out the distance between the mouse and the movieclip (script 2) but i cant seem to integrate the two...anyone done this? ...any help on this would be great...

Thanks...








Attach Code

script 1 - friction.


xmov = 50;
decay = .99;
this.onEnterFrame = function() {
if (_root._xmouse > Stage.width/2) {
this.cam.x += xmov;
}
}

script 2 - distance

mc1 = this.cam.x
onEnterFrame = function() {
var dx:Number = mc1._x - _xmouse;
var dy:Number = mc1._y - _ymouse;
var dist:Number = Math.round(Math.sqrt((dx*dx) + (dy*dy)));
trace(dist);

}

LoadMovie And Relation In Code
Here's my problem: i got a main SWF playing. At the end, another swf is loaded inside an MC named dropZone with "loadMovie" actionscript.
but inside my second swf, i got a dynamic textbox called content_TXT in an MC named texteMC who load a html file, and a custom scrollbar called slider.
If I do CTRL+ENTER to test the movie itself, work fine, everything is scrolling right. but if i put all thing on web server, the scrollbar is no more scrolling the dynamic text. here's some code:

texteMC actionscript
onClipEvent (enterFrame){
_parent.texteMC.content_TXT.scroll = _root.slider.b;
}

slider actionscript
onClipEvent (load){
setProperty (this, _x, int(_x));
}
onClipEvent (enterFrame){
a = new Object();
a.y = this._y;
a.x = this._x;
_parent.path.globalToLocal(a);
b = int(a.y/(100/_parent.texteMC.content_TXT.maxscroll));
}

IF anyone can help to solve this scrolling problem, that's gonna be great. I'm sure this is a question of _root or _parent somewhere but can't put the finger on it....





























Edited: 10/03/2007 at 08:17:08 AM by Raskriall

Speed In Relation To Distance....
Hi,

Is there a way i can make a movieclip speed up or slow down according to the distance between the mouse and the movieclip? I've made a friction effect for a movie clip (script 1) and i have a script to work out the distance between the mouse and an object (script 2) but i cant seem to integrate the two...anyone done this? I dont understand the distance script 100%, i pretty much got it from a book i own....any help on this would be great...

script 1 - friction.

Code:
xmov = 50;
decay = .99;
this.onEnterFrame = function() {
if (_root._xmouse > Stage.width/2) {
this.cam.x += xmov;
}
}
script 2 - distance

Code:
var mc1 = largest_mc;
onEnterFrame = function() {
var dx:Number = mc1._x - _xmouse;
var dy:Number = mc1._y - _ymouse;
var dist:Number = Math.round(Math.sqrt((dx*dx) + (dy*dy)));
trace(dist);

}
Thanks...

Javascript Flash Relation
Hi, I currently make a website in html. creating a website from a photoshopdesign in html goes quite ok. I only want my site to be more interactive and alive so I want to move on to creating pages in flash. I therefore looked at the source of some professional flash pages and i see lots of javascript. I know almost nothing about javascript, so my question is...Is it neccesary to have a good knowledge of javascript when you want to create a websites in flash? What i always thought is, you create flashfile and then put it in a html file like a single image.
If someone would explain this to me i would really appreciate it.

Loadmovienum And Unloadmovienum In Relation To Levels
Hi guys this is my 3rd post on this subject. I am on with a project at the moment where I simply or so I thought load external swf's into differnet levels on the main stage yet some buttons work and some dont. I have tried every combination to try and get this working but have failed each time. Now due to my ever increasing frustraion I have now placed the project online and included the FLA's so if anyone with MX would care to download them and see what is going wrong I would appreciate it.

The link is as follows http://www.gallstone-surgery.com/site/index.html

cheers

aaron

Playing MovieClip In Relation To Drag.
How can i have it so that when someone presses the mouse, and drags it say, 100 pixels to the left, a movieclip will play, corresponding to how far you have moved the mouse. So if you have clicked+dragged 50 pixels the movie will have played half of its timeline, drag of 25 pixels = quater played.? Also so that you can drag it back and forth - altering the movieclip constantly.

Cany anyone help? Thanks.

Frame Change To The Relation Of 'ymouse'
I have a scroll bar the is in a series of 29 frames. Depending on the height of the mouse I want the frame number to change. It mainly work exept one thing It's a little to jumpy. How can I change this??
Please help.

Thanx, I'll attach a file aswell.


Code:
onClipEvent(load) {
move = false;
drag = false;
screenWidth = 500; //your screen width
numberOfFrames = 29; //number of frames in your shotgun anim
ratio = screenWidth/numberOfFrames; //create 29 sections, each 560/29 (screenWidth / numberOfFrames) in length
}
on(press) {
_root.scrollBar.bar.gotoAndStop(frame);
}
on(dragOut) {
_root.scrollBar.bar.gotoAndStop(frame);
}
onClipEvent(enterFrame) {
yMouse = _root._ymouse; //position of mouse on screen
frame = ((yMouse - (yMouse%ratio)) / ratio)+1;
trace(frame)
}

Flash Detect, In Relation To GoogleBot
I'm searching for the best method for flash detection,
in its relation to GoogleBot.

The GoogleBot has kicked back a number of submissions,
due to the site not allowing the user to make use
of the browsers back button.
I've found a way around this by using javascript (ie history.go(-1)).

So now i face a new question.

What if the user has javascript turned off?

Even if i use a different method of detecting flash,
the code that fixes the issue of the browsers back button
is no longer seen by the browser.

SO.....the ultimate question >

how can i both make use of
- "flash detection (which redirects the user to other webpages)"?
- and "allow the back button to redirect back to google"?

Making 3 Movieclips Work In Relation To Each Other
hey

please see the attached .FLA....

as you can see there are three grey boxes and three red buttons. When you click the red button it causes the respective box to move up or down, imagine it closed by default and open when down after clicking the button.

the effect i need to create is that if boxs 2 and 3 were open and box 1 was closed, clicking the box 1 button would cause boxs 2 and 3 to shut first and then box1 would open. This would work with any combination of boxes.

The result would be that if you clicked a closed box button it would shut any open boxes first.......

hopefully this makes sense, i have a very very basic knowledge of actionscript and have tried to work it out myself but just doesnt seem to want to work. Any help would be hugely appreciated.

cheers all

bast

Relation Of Frame1 And Frame 3 Script
In frame 1, I use sth like this script
function makeMove(myScore, yourScore){
// Have a shoot
if(turn == "C"){
myScore += 5;
//doSend(myScore, yourScore)
} else {
yourScore +=5;
//doSend(myScore, yourScore)
}
}

in frame 3, I use this for my button
on(press){
makeMove(11, 3)
}

but the variable doesnt pass to frame 1.
Do anyone have any ideas how to work it out?

Movieclip Position (X-Y) In Relation With The Scene
Hi, been trying to figure out an easy way to determine the X-Y coordinates of a movieclip which is already inside another movieclip. The parent movieclip is not animated, and the movieclip inside moves up and down.

If I ask to trace the coordinates of the object, it gives me the coordinates the movieclip has INSIDE it's parent.


Code:
trace("_root.parent_clip.target_clip._y");
I'd like to be able to determine it's position in the global scene. Is there a way ?

Thanks !

Mute Btn Problem(relation With Slider)
hi all

i have three problems
1) mute btn is not working properly in relation with slider
when i click play and then click mute it mutes and then again pressing mute it doesnt unmutes but the sound doesnt play

2)timer showing 00:00 when clicked play then pause then play then stop and again play (timer shd show song timing)

3)scrubber playhead is coming from 0th position not coming from where the loader position

here is the attached file and click the FM channel the controls will be shown

How To Make Mc Move In Relation To Scrolling?
How do I make an mc move in relation to the amount I scroll a text? I am not advanced enough to be able to break down the (Flash UI)scrollbar component and change it to my own liking (if it's possible) so I'd like to fake it.
I have two mc's that make my text scroll up or down and I'd like to have a mc moving in between them like a regular scrollbar.
The code on the mc's that scroll:

ActionScript Code:
this.onEnterFrame = function() {    if (pressing == true) {        _root.mcholder.texten.scroll = _root.mcholder.texten.scroll+movement;    }};

and on the button:

ActionScript Code:
on (press) {    pressing = true;    movement = -1;}on (release) {    pressing = false;}

with movement =+1 on the other button


or can someone point me to a tutorial?
Thanks in advance

Position Of One MovieClip In Relation To One Underneath
Hi folks,

I would like to return the x and y co-ordinates of one MovieClip in relation to another.

So, for example, if I had a movieclip of a small square (small1_mc) over/on a higher layer of a larger square (large1_mc) I need to know where the registration point of small1_mc is on large1_mc. I need to do this without using the cursor position i.e. so I would like a user to be able to click a button that returns the position rather than clicking on small1_mc.

I would appreciate any help because the only way I can think of doing this is to record the cursor position on large1_mc when small1_mc is clicked. Sorry if this is a no brainer but it's confused me!

Many thanks

Duff

Movieclip Position (X-Y) In Relation With The Scene
Hi, been trying to figure out an easy way to determine the X-Y coordinates of a movieclip which is already inside another movieclip. The parent movieclip is not animated, and the movieclip inside moves up and down.

If I ask to trace the coordinates of the object, it gives me the coordinates the movieclip has INSIDE it's parent.


Code:
trace("_root.parent_clip.target_clip._y");
I'd like to be able to determine it's position in the global scene. Is there a way ?

Thanks !

How To Make Mc Move In Relation To Scrolling?
How do I make an mc move in relation to the amount I scroll a text? I am not advanced enough to be able to break down the (Flash UI)scrollbar component and change it to my own liking (if it's possible) so I'd like to fake it.
I have two mc's that make my text scroll up or down and I'd like to have a mc moving in between them like a regular scrollbar.
The code on the mc's that scroll:

ActionScript Code:
this.onEnterFrame = function() {    if (pressing == true) {        _root.mcholder.texten.scroll = _root.mcholder.texten.scroll+movement;    }};

and on the button:

ActionScript Code:
on (press) {    pressing = true;    movement = -1;}on (release) {    pressing = false;}

with movement =+1 on the other button


or can someone point me to a tutorial?
Thanks in advance

Positioning And Scaling A Movieclip In Relation To The Stage...
I'm using the "Full Browser Flash" technique and all is working well with one exception, I can't seem to get a movieclip to scale itself to the stage size and then animate.

Example:

I have a movieclip that spans the width of the stage. The code to implement this technique for the FBF stage is working. What I want to do is 1) detect what the size of the stage is, 2) position the movieclip off of the stage using the detected stage size [i.e.: (._x=0-Stage.width)] and 3) animate this movieclip from it's off screen location to it final position.

Let's say the stage size is detected to be 800 pixels wide. This would scale the movieclip to 800 pixels wide. Then the movieclip would be positioned off the stage at an x coordinate of -800. Then the movieclip would animate to the x coordinate of 0.

Make sense?

Please advise. Thanks.

Setting A Movies Alpha With AS In Relation To Timeline
Hey guys!
I have a queston about setting the alpha on a specific movie clip when the timeline hits a certain frame.
Basically thats what i need to know in a nutshell.
so yeah, for example, when my timeline hits frame 200 i want my movie to have its alpha set to 100 from like 50, which is already set.
If anyone has a clue on how i can get this i would be super stoked!
thanks alot for any help!

Resize Movie In Relation To Window Size
Hey Guys,

I was wondering if anyone could help me figure out how to resize a movie based on the window size. It seems as it would be as easy as making the movie 100% proportional to the broswer window, but it only resizes the flash document, not the content in it. Is there a way to have the entire thing resize?

here is what i'm working on (inprogress)
http://www.vespera.com/dunham_farm_book.html
I'd like the flash file to resize with the browser window.

Any suggestions?

Thanks,
Moez.

How Do I Find The Coordinates Of An Object In Relation To The Stage?
I have a character that moves around. On that character is a dot that circles around him. How would I find the _x and _y properties of that dot in relation to the stage's origin?

Hue, Saturation, Brightness, Contrast, In Relation To ColorMatrixFilter
I have been trying to read how Hue, Saturation, Brightness, & Contrast relate to the ColorMatrixFilter. Since there is no saturation, brightness, contrast, or hue methods, these all have to be manipulated by hand which means a very clear understanding of what these things are is needed.

So does anyone know how any of these releate to the ColorMatrixFilter?

Other Methods Of Data Error-checking In Relation To IE?
OK, I'm at wits end trying to baby spoonfeed this stupid browser (Internet Explorer, IE; more like Inexplicable Errors). Here's the link to what I'm trying to build:

http://www.perseeve.com/phot.html

(Right now the thumbnail animation and _alpha changes are taken out, it's just a very plain-jane put-it-on-stage method for now just so I can see exactly how the browser is loading the images.)

What I'm trying to do: Basically, if you run that link in Safari or Netscape it loads the external thumbnail images in exactly the order that I want them to load, no problems. In IE, for some reason beyond my comprehension, it loads images (after a certain number have loaded? or byte size?) in an order that I did not specify, and also loads them onto the stage WELL AFTER the Flash error-checking code I have says they're SUPPOSEDLY 100% on-stage (getBytesLoaded() == getBytesTotal() && mc._width > 0).

What I'm looking for is either:

A) A solution on how to force IE to load EVERY SINGLE IMAGE onto the stage in the order that I want and make sure it actually displays before moving on in the timeline, or

B) Another error-checking method to see if an image is successfully loaded into a blank movieClip (already tried getBytesLoaded() == getBytesTotal() and _width > 0, as seen above).

ANY HELP IS 2000% APPRECIATED. I've been banging my head against this particular wall for faaaaar too long.

Here's the functions that pertain to the loading of the thumbnails:

Frame 1:

PHP Code:



function checkLoop() {
    var i = 0;
    int_checkWidth = setInterval(this, "checkWidth", i+54, this["thumb"+i].jpgLoader);
};

function checkWidth(targ) {
    twc.text = "totalWidthCount: "+totalWidthCount;
    if(targ.getBytesLoaded() >= targ.getBytesTotal() && targ._width > 0) {
        totalWidthCount++;
        twc.text = "totalWidthCount: "+totalWidthCount;
        i++;
        if(totalWidthCount == thumbCount) {
            clearInterval(int_checkWidth);
            thumbsLoaded = true;
            i = 0;
        }
    } else {
        twc.text = "ERROR";
    }
};

function slowFeed(targ) {
//->this["thumb"+inc].jpgLoader._opacity = 0;
    this["thumb"+inc].jpgLoader._opacity = 100;
    this["thumb"+inc].jpgLoader.loadMovie(targ[inc]);
    inc++;
    if(inc == thumbCount) {
        checkLoop();
        clearInterval(int_slowFeed);
    }
};

function slowFeedLoop(targ) {
    inc = 0;
    clearInterval(int_slowFeed);
    int_slowFeed = setInterval(this, "slowFeed", 5, targ);
}; 




Frame 2:


PHP Code:



slowFeedLoop(sec0Thumb);
//sec0Thumb is the name of the Array that holds the
//paths/names of the JPGS I want to load. 

XML File Path In Relation To Movie & HTML
Hello Group

I have a SWF movie which does an XMLObj.Load on an XML file and then applies the text in the various XML nodes to text fields in the SWF movie.

Can someone please confirm or deny what I think I'm seeing...

If I put the movie and XML file in the same folder on a web server and type the address to the movie (e.g., http://www...../my.swf) it works great.

If I embed the movie in an HTML file it seems that the SWF movie can only find the XML file if the HTML, the SWF file and the XML file are all in the same web server folder.

If, for example, the HTML page is in folder X, and the SWF and XML files are in folder Y, the movie loads but behaves as if it can't find the XML file.

Does this sound right?

Ideally I want the SWF and the XML in one folder, and the HTML file in another.

Thanks for any input.

PeteB

Parent - Child Relation: Width Issue
I probably am missing something, but when I change the width of a parent movieclip, the width of the child movieclip also changes.

Like I start with this:



and do
Code:
parent.width *= 2;
then the width of the child will also double, which I don't want to happen. Is there some kind of property I need to set so that the width of the child does not change when the width of the parent changes?





Thanks!

Volume Control In Relation To Track Position
is there a way to automatically control the volume of a sound in relation to its track start and end, ie for example tell AS to fade it in for the first 2 seconds since beginning of the track or fade it out starting the fade out 1 second before the track ends?

PS this is a streamed track and not linked to timeline (all done through AS)

Trying To Make Thumbnail Scroll In Relation To The _xmouse Location
I'm trying to make a group of thumbs scroll within a small window, in the opposite direction of the mouse. I've seen this done a million times, but I'm not the best with motion math. any help would be greatly appreciated.

Would I Scale An Object In Relation To The Length Of A Loaded Movie?
I know this should be straight forward but I'm at a loss as to which command to use.

I am loading video.swf into load_mc.

Once the video begins playing I want a (percent played) bar to begin growing.

If the video is 30 seconds long at 30 fps -- the bar would reach 100% of its size when the loaded video hits frame 900 (the end of video.swf).

Any help is greatly appreciated!
Thanks. Pete

Is This Forum Meant Only To Talk About Things In Relation To Flash?
I'm confused! When I click New posts (in the blue bar near the top) it shows up with all these random threads for example..I saw a thread about Live free or die hard...so that leads me to believe you can talk about whatever you want? And if that IS the case...what section do I make those posts in! Thanks.

Any Good Sites That Explain Scope In Detail In Relation To OOP
I have a few books (including moocks AS2.0) but I'm running into some annoying scope and targeting issues of MC created inside classes and wonder if there is a better way to go about it. Hence my question has anyone seen any place or even other books that cover scope in great detail with examples of more complex issues.

Sky Effect - Light To Dark Changing In Relation To Computers Clock
Can anyone help me with creating an effect in Flash so that the sky in an animation I am creating will change as it gets later? By reacting to the computers clock.

thanks

Making A Graphic Or Movie Clip Move In Relation To Keyboard Buttons
I would like to know how to move little people around a world I made by pressing the left right up and down keys on the keyboard. Kind of like disorderly at http://www.newgrounds.com/disorderly but a top view.

Loaded Movies Are Not Transparent In Relation To The Html On Which Base Movie Is Embe
loaded movies are not transparent in relation to the html on which base movie is embedded ;

I have noted that the movies loaded over the base movie are not transparent in relation to the html “background” ;
- ( loadmoviesNUM(whatever.swf ,2´´) for instance is not transparent when loaded over the base movie ;
Base movie is embedded on a htm ( EMBED src="basemovie.swf" quality=high wmode=transparent .......... ) where it appears transparent ;
It conflicted with the kind of lay out I had in mind as I need such transparency feature (disconsidering Net Scape Nav.) ;
Is there a way to became transparent the loaded movies as well ???
Regards

Copyright © 2005-08 www.BigResource.com, All rights reserved