Keeping Draggable Mc On Stage
I have a movieclip that is draggable, scalable, and rotatable. i want the user to be able to dragg the movieclip to any position as long as it stays completely on the stage. all works fine using the constraints of x and y in startdrag as long asthe image isn't scaled or rotated. but if it is either then the constraints are based uopn the original orientation and size. so if the MC is scaled up and then dragged part of it will go off screen, or if it is scaled down i end up with a gap. any thoughts? i tried putting little pixel sized MCs on the corner and then hittesting them on a pixel sized border, but that failed, and i tried taking a snapshot of the mc in its current status and testing that but it didn't seem to work either. it still records the original size and rotation
how do i test based upon current size, and rotation
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 04-27-2006, 07:48 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Keeping Character On Stage Plus Keeping Moving Background With Character On Stage
Im in the process of creating a superman game.. and i right now have him in walking mode .. i created him which is superman_mc . which has his waking animations etc.. inside and i have created a background mc which is level1_mc which basicly moves along with superman as he walks. .the problem i am getting is keeping the back ground from moving off the stage and superman from going off the stage i can keep superman on the stage and in one place on the stage with the code i have now but the background still moves off.. here is the code i have :
stop();
//Superman walk & flying movements
fly = "off";
_root.onEnterframe = function() {
if (Key.isDown(70)) {
_root.superman_mc.gotoAndPlay(4);
_root.superman_mc._y -= 17;
fly = "on";
}
if (_root.superman_mc, hitTest(_root.right_mc)) {
_root.superman_mc._x = 700;
}
//moves superman right
if (Key.isDown(39) & fly == "off") {
_root.superman_mc.gotoAndPlay(3);
_root.superman_mc._x += 17;
_root.level1_mc._x -= 17;
direction = "center";
//makes superman face foward
} else if (direction == "center") {
_root.superman_mc.gotoAndStop(1);
}
//moves superman left
if (Key.isDown(37) & fly == "off") {
_root.superman_mc.gotoAndPlay(2);
_root.superman_mc._x -= 17;
_root.level1_mc._x += 17;
direction = "left";
} else if (direction == "left") {
_root.superman_mc.gotoAndStop(1);
}
};
whats happening is that the background keeps going but since i have it setup to move along with superman .. if anyone can help thank you alot..
-rob-
Keeping Character On Stage Plus Keeping Moving Background With Character On Stage
Im in the process of creating a superman game.. and i right now have him in walking mode .. i created him which is superman_mc . which has his waking animations etc.. inside and i have created a background mc which is level1_mc which basicly moves along with superman as he walks. .the problem i am getting is keeping the back ground from moving off the stage and superman from going off the stage i can keep superman on the stage and in one place on the stage with the code i have now but the background still moves off.. here is the code i have :
stop();
//Superman walk & flying movements
fly = "off";
_root.onEnterframe = function() {
if (Key.isDown(70)) {
_root.superman_mc.gotoAndPlay(4);
_root.superman_mc._y -= 17;
fly = "on";
}
if (_root.superman_mc, hitTest(_root.right_mc)) {
_root.superman_mc._x = 700;
}
//moves superman right
if (Key.isDown(39) & fly == "off") {
_root.superman_mc.gotoAndPlay(3);
_root.superman_mc._x += 17;
_root.level1_mc._x -= 17;
direction = "center";
//makes superman face foward
} else if (direction == "center") {
_root.superman_mc.gotoAndStop(1);
}
//moves superman left
if (Key.isDown(37) & fly == "off") {
_root.superman_mc.gotoAndPlay(2);
_root.superman_mc._x -= 17;
_root.level1_mc._x += 17;
direction = "left";
} else if (direction == "left") {
_root.superman_mc.gotoAndStop(1);
}
};
whats happening is that the background keeps going but since i have it setup to move along with superman .. if anyone can help thank you alot..
-rob-
Keeping The MC On To The Stage.
I have the actionScript for an MC to move around using the arrow keys but it can move off the screen. Is there any script to keep the MC on the screen?
Keeping Mc On Stage
o.k. my last post was way too confusing
I am trying to have an image that is controlled by the mouse and increases in size as the user steers around the pic. The problem I am having (one of em) is that the mc is not confined to the stage
I am trying to have the action scripts control the mouse movement and use tweens for the resize. The reason I am doing it this way is because when the image reaches a certain size I want a new image to fade in and then be controlled by the mouse in the same way. I am sure this can all be done through scripting but I have no idea how.
hmmm.. i think that is just as confusing
here is the source if anyone wants to help me out:
http://www.folkphotography.com/index...testflight.fla
Thanks to anyone for any help.. I am so close to finishing this project.. just got to get this licked
here is the code I am using
onClipEvent (load) {
// This code assures that the movie clip has larger width and height dimensions than the Stage does
// It scales up the movie clip proportionally until BOTH its width and height are larger than the stage
while (this._width<Stage.width || this._height<Stage.height) {
this._xscale += 1;
this._yscale += 1;
}
}
// end onClipEvent(load)
onClipEvent (enterFrame) {
// Use this variable to set a maximum "speed limit" for the motion
maxSpeed = 20;
// Use this number to adjust the overall "responsiveness" (speed) of the motion
speedMultiplier = .05;
//
// First, we calculate the target position for the clip.
// The target postition is based mainly on the (x,y) position of the
// mouse on the stage, but it also takes into account the dimensions of this movie clip.
//
targetPositionX = -1*(_root._xmouse/Stage.width)*(this._width-Stage.width);
targetPositionY = -1*(_root._ymouse/Stage.height)*(this._height-Stage.height);
// Next we calculate the distance from the targetPosition(s)
distanceFromTargetX = Math.abs(this._x)-Math.abs(targetPositionX);
distanceFromTargetY = Math.abs(this._y)-Math.abs(targetPositionY);
//
// Then we calculate the "speed" at which the movie clip will move. This is actually
// calculating the distance (in pixels) that the movie clip will move this frame.
//
speedX = (distanceFromTargetX*speedMultiplier);
speedY = (distanceFromTargetY*speedMultiplier);
// Reinforce the speed limit with these two if conditionals
if (speedX>maxSpeed) {
speedX = maxSpeed;
}
if (speedY>maxSpeed) {
speedY = maxSpeed;
}
//
// Then we actually move this movie clip based on the following logic:
// "If this movie clip is not already at its target position, then move
// it toward the target position by speedX and speedY calculated above."
//
if (this._x != targetPositionX) {
this._x += speedX;
}
if (this._y != targetPositionY) {
this._y += speedY;
}
//
// Finally, the following code will make sure the movie clip always fills the stage.
//
if (this._x>0) {
this._x = 0;
}
if (this._y>0) {
this._y = 0;
}
if (this._x+this._width<Stage.width) {
this._x = this._width+Stage.width;
}
if (this._y+this._height<Stage.height) {
this._y = this._height-Stage.width;
}
// This statement helps make the animation smoother under certain conditions.
updateAfterEvent();
}
// End onClipEvent(enterFrame)
Keeping The Stage Centered
i m using this script
var stageListener:Object = new Object ();
stageListener.onResize = function ()
{
stageSize_txt.text = "Stage.width:" + Stage.width + " Stage.height:" + Stage.height;
// position mc's
tl_mc._x = tl_mc._y = 0;
tr_mc._x = Stage.width - tr_mc._width;
tr_mc._y = 0;
bl_mc._x = 0;
bl_mc._y = Stage.height - bl_mc._height;
br_mc._x = Stage.width - br_mc._width;
br_mc._y = Stage.height - br_mc._height;
};
Stage.scaleMode = "noScale";
Stage.align = "TL";
Stage.addListener (stageListener);
// call resize function
stageListener.onResize();
in a full screen flash page, to keep some mc in the corners of the browser. and now my stage doesn't stay centered anymore. if i change Stage.align = "TL"; to Stage.align = "MC"; the stage will center itself, but the mc from the corners move with it to.can it be done?please help again
Keeping A Window A Certain % From 0,0 Of Stage
Hey guys,
I'm working on a full screen flash site with a floating content window and a menu bar. You can see what I have so far at
http://ostari.com/ronnie/point1
Now you notice when you resize the window just stays in the top left. That is ok however what I would like to see is the window float a certain percent from 0,0 of the stage. I say this because If the users resolution is big, the window seems kind of far from the menu, but say they have 1024x768 they are relatively close. Maybe I am going about this the wrong way, but basically I just would like to see the window and menu bar closer together the bigger resolution they have. Thanks.
-Ronnie
Keeping A Window A Certain % From 0,0 Of Stage
Hey guys,
I'm working on a full screen flash site with a floating content window and a menu bar. You can see what I have so far at
http://ostari.com/ronnie/point1
Now you notice when you resize the window just stays in the top left. That is ok however what I would like to see is the window float a certain percent from 0,0 of the stage. I say this because If the users resolution is big, the window seems kind of far from the menu, but say they have 1024x768 they are relatively close. Maybe I am going about this the wrong way, but basically I just would like to see the window and menu bar closer together the bigger resolution they have. Thanks.
-Ronnie
Keeping An Object Coving The Stage
Any help on this would be greatly appreciated. I have an object that is serving as a background for a flash website. The background object (a table) moves and rotates around when clicked, exposing different parts of the table on the stage when the user clicks.
Here is the site so far:
http://www.personal.psu.edu/jwc5062/
My problem is when i want to transition between two points on the table, the table has to rotate and move.. and by just using a motion tween between the two points results in the table rotating off the stage for a few frames (thus exposing the background and making it look really cheezy). I was trying my hand at using motion guides, but can't do it with any accuracy.
So, my question is: Is there a way to guide an object as it rotates and moves so that it doesn't move off screen? (there is plenty of room on the table if i can just guide its path through the 2 second transition). Thanks for any support.
Keeping An Object Only On The Stage And Only Controling It There...?
If you check out this http://www.zen57616.zen.co.uk/excession/ (its a demo, yes I know frames are bad etc)...I have a little sliding bar which moves with the mouse on the menu, however if you click off the movie area on any part of the website it will follow the mouse presses. This could be very anoying for people so is there any way to make sure it is only controlable on the stage area?
Sorry if thats badly explained.
Keeping Randomly Placed Objects Within The Stage
Hello,
I am placing 10 movie clips randomly within the stage using this simple script:
Code:
for(i=0; i<10; i++) {
var t = this.attachMovie("imgs","imgs"+i,i);
t.cacheAsBitmap = true;
t._x = Stage.width*Math.random(550);
t._y = Stage.height*Math.random(450);
t.onRollOver = function(){
this.swapDepths(this._parent.getNextHighestDepth());
}
}
What I am trying to figure out is how to keep all the objects contained within the stage bondaries. Right now some of them are going off screen when they are placed, and this looks goofy when placed in the HTML page I am creating.
Any ideas on keeping them contained in an area so the edges are all within said area?
thanks,
jsm_
Keeping An Attached MC Position Relative To Stage
Keeping an attached MC position relative to Stage even if _parent clip is scrolled?
I'm revising my original question with some of my AS. I'm using Laco tween prototype if anyone gets confused with some of this ...I've commented the AS below with what MCs I want positioned relative to the stage.
///beginAS
for(i=1;i<12;i++){
var iconX=Stage.height/2
var iconY=Stage.width/2
var itemNumber=1
thisItem="item"+i;
this["box"+i].onPress= function(){
trace(boxCount)
blueprints.centerHolder.alphaTo(100,.3);
//The attached MC below are what I want to stay centered to the stage, but only before they are clicked. It's parent MC can be moved Left/Right/Up/Down using scripted buttons, so I don't want the attached MCs moved with it
blueprints.attachMovie(this.thisItem,"box"+itemNumber,boxCount,{_x:iconX,_y:iconY});
onEnterFrame = function(){
if(moveThisDown){blueprints._y-=5;blueprints.centerHolder._y+=5}
if(moveThisUp){blueprints._y+=5;blueprints.centerHolder._y-=5}
if(moveThisLeft){blueprints._x-=5;blueprints.centerHolder._x+=5}
if(moveThisRight){blueprints._x+=5;blueprints.centerHolder._x-=5}
if(rotateThisRight){selectedMCFull._rotation+=5;}
if(rotateThisLeft){selectedMCFull._rotation-=5;}
if(zoomThisIn){blueprints._width+=blueprints._width/100;blueprints._height+=blueprints._height/100;}
if(zoomThisOut){blueprints._width-=blueprints._width/100;blueprints._height-=blueprints._height/100;}
if (defaultThisZoom){blueprints.scaleTo(100,.8,"easeOut")
}
}
blueprints["box"+itemNumber].thisIsSelected="false";
blueprints["box"+itemNumber].alphaTo(100,0);
blueprints["box"+itemNumber].scaleTo(150,0);
blueprints["box"+itemNumber].scaleTo(100,.6,"easeOutBack");
blueprints["box"+itemNumber].nums.thisNumber.text=itemNumber;
blueprints["box"+itemNumber].onEnterFrame = function(){
blueprints["box"+itemNumber]._x=Stage.height/2
blueprints["box"+itemNumber]._x=Stage.width/2
}
blueprints["box"+itemNumber].onPress = function(){
this.swapDepths(boxCount);
selectedMC = this.main;
selectedMCFull = this;
this.startDrag(true);
this.main.alphaTo(100,.5);
this.num.alphaTo(100,.5);
this.nums.scaleTo(100,.2,"easeOutBack");
this.main.scaleTo(100,.2,"easeOutBack");
}
blueprints["box"+itemNumber].onRelease = function(){
this.thisIsSelected="true";
blueprints.centerHolder.alphaTo(0,.8);
this.stopDrag();
this.main.alphaTo(85,.5);
this.nums.alphaTo(100,.5);
this.nums.scaleTo(100,.2,"easeOutBack");
this.main.scaleTo(80,.4,"easeOutBack");
boxCount++;
}
}
this["box"+i].onRelease= function(){
itemNumber++
}
}
// end AS
Hopefully the code is readable ...thanks guys. If anyone needs the FLA to review, please email me at bryan AT bleedingtree.com or MSN Messenger with the same address.
Draggable Object Within Stage Dimensions
I've got a simple draggable box, but when it's dragged about the stage, I don't want it to "disappear" if part of it is beyond the boundaries of the stage (in my case 780x412). Is there any way to stop a draggable object from "vanishing" beyond the border?
Thanks!
Kirupa Picture Gallery / Keeping The Image On Stage As New Image Loads
Hi, I have the Kirupa Image Gallery implemented and it works great. But I was wondering how I can go about having the image stay on screen as it is loading the next image, so it's not such an abrupt transition. Currently the image container goes blank as it loads the next image. I assume I will need another image movieclip that sits underneath the first one... but then what?
Thanks!
Keeping The Center Of The Stage In The Center Of A Web Browser
Hey,
I have a really wide flash page, but the main portion of it is in the center
of the .swf. My question is how do I make the center of my .swf in the center
of a web browser so that when the user resizes the browser, the center of the stage stays in the center of the browser? Right now it has the left side of the .swf aligned with the
left edge of the browser so the center of my .swf is usually being cut off by
the right edge of the browser and users have to scroll to the right to see the
main portion of the site...I'm sorry if that's somewhat confusing, but any help
at all would be appreciated. Thanks!
Dave
Draggable Item On A Draggable Mask
hello, i was trying to make a sniping game, and i can get the mask to drag. but i want crosshairs and it won't appear in the mask, so i put it on a diff. layer and it still won't work. has anyone had this same problem, and if so, please help me.
Unhappy Adjusting Columns And Rows On Stage Resize, According To Stage.width.
Hey fello flashers,
what i'm trying to achieve can be seen here, at the FWA's website.
When you resize the browser window the thumbnails rows and columns adjust accordingly to fit.I've managed to attach the thumbnails correct when my enableButtons() function is called but i'm unsure how to approach resizing.
if anyone has encounted this problem before or can help, then pls do i'm a little confounded on this one.
thanks
cam
Stage.align = "TL";
var numberOfGalleries:Number = 20;
var thumbMarginX:Number = 163;
var thumbMarginY:Number = 109;
function init():Void {
enableButtons(numberOfGalleries);
resizeStage();
}
function enableButtons(numberOfGalleries:Number):Void {
currentRow = 0;
currentColumn = 0;
for (i=0; i<numberOfGalleries; i++) {
tracker = i;
thumbsDisplayer = this.createEmptyMovieClip("thumbsDisplayer_mc", this.getNextHighestDepth());
currentThumbnail = thumbsDisplayer.attachMovie("thumbnail holder", "thumbnail"+(tracker+1), thumbsDisplayer.getNextHighestDepth());
currentThumbnail._x = currentColumn*thumbMarginX;
currentThumbnail._y = currentRow*thumbMarginY;
currentColumn++;
if (currentThumbnail._x>(Stage.width-(currentThumbnail._width + thumbMarginX))) {
currentRow++;
currentColumn = 0;
}
}
}
function resizeStage() {
var myListener:Object = new Object();
myListener.onResize = function(e:Object):Void {
//
}
Stage.addListener(myListener);
}
init();
Create Array On Stage, Mathematically Referring To Objects On The Stage
Ok what I want to do is create a set of small images on the stage and name them sequentially like you would an array, then refer to them mathematically in actionscript. I tried naming them as an array but it says that the name is reserved for the system or something. Does anyone know how to get an array of objects onto the stage, or have an idea of something else I could do to get the same effect?
Create Array On Stage, Mathematically Referring To Objects On The Stage
Ok what I want to do is create a set of small images on the stage and name them sequentially like you would an array, then refer to them mathematically in actionscript. I tried naming them as an array but it says that the name is reserved for the system or something. Does anyone know how to get an array of objects onto the stage, or have an idea of something else I could do to get the same effect?
Stage.width And Stage.height Not Matching Document Settings?
Ok, so I have no idea why this would be happening and its driving me nuts. I have my Flash movie size set to 960x650. However, when I trace stage.width and stage.height, I get:
950.05x630
Why in the world would this be happening? It's screwing up all the work I'm trying to put into positioning elements relative to the stage size. Thanks for any help!
Stage.height And Stage.width Erratic Values?
Hey folks,
I was wondering if it happens in all Flash everywhere, or just in mine:
When I trace Stage.height and Stage.width, I always get erratic values:
Stage.height gets me always 4 pixels less than real
Stage.height gets me always 104 pixels less than real
This, way if my stage has 760 x 400, it will return values 756 x 296.
Anybody knows why?
Thanks!
F8 Movieclip Change On Stage Causes The Entire Stage To Dissapear
I have my stage with a background picture.
On stage left are buttons, and on stage right I have a movieclip (mc_Preview).
When the user puts his mouse over each button I would like the movieclip to move to a different frame.
the problem is when the mouse moves over a button, i see the movieclip move but then the entire stage dissappears and turns a few shades of gray.
Does this sound familiar to anyone?
Any help would be greatly appreciated!
External MC Loaded On Stage, I Can Press Buttons That Are On The Stage Through It...
I'm used to AS3, and I don't have much experience in AS2. I'm trying to modify an older flash file done in AS2.
An external swf is loaded using this code...
ActionScript Code:
on(release) {
loadMovieNum("supplimental/external.swf", 500);
}
The problem is that even though this external movie covers the whole stage, My mouse can still "see" buttons that are on the stage, and I can click them. I don't want to be able to click the buttons through my external movie. Thanks for any help.
Stage.width, Stage.height, Add.Listeners Problem
Hi
i found the way yesterday to ensure my mc stays full screen. now i want to animate the same mc if i can in reaction to a button click.
not sure how this next step goes. do i need another addlistener to the background mc that im tweening ?
kindly check the .fla. to see what i mean.
its very rough cut but hopefully you can get the gist of it.
when the text button is clicked, the bg reverts to the top left of the screen.
thanks
-dj
MX2004 -- Stage.height And Stage.width Different From Mac To Windows
I have a really strange problem that is ruining my movie. I have set the size of the stage to 450px by 400px in the properties dialog. In my actionscript, I've got all kinds of things that rely on Stage.width. So, I developed everything in MX2004 on Mac, and everything worked swimmingly. So, I opened up the exact same file in MX2004 and everything is placed wrong on the stage. So when I did a trace of Stage.width, I got 940px, and a trace of Stage.height gave me a figure of 763 pixels. If I do the same traces on the Mac, I get what I expect, 450px for width and 400px for height. Does anybody have any ideas as to what might cause this kind of discrepancy?
Thanks,
John
External MC Loaded On Stage, I Can Press Buttons That Are On The Stage Through It...
An external swf is loaded using this code...
Code:
on(release) {
loadMovieNum("supplimental/external.swf", 500);
}
The problem is that even though this external movie covers the whole stage, My mouse can still "see" buttons that are on the stage, and I can click them. I don't want to be able to click the buttons through my external movie. Thanks for any help.
Keeping The Nav On Top
Hi, I've got a fla that uses duplicate movie clip, the only problem being when a new swf is loaded it covers the Nav, is there some way to keep the nav elements on top of the loaded swfs?
Could someone please drop me some code or have a look at the attached fla.
Keeping Rolloverstate
help needed!
I'm creating a dynamic menu. There is just a small detail left.
On rolover my Main Items (buttons) change color, but when moving down over subitems of course the over state is no longer active. I need the over state to stay untill next Main Item is encountered.
Thank you for helping!
/marcus
Keeping Up With My Images...
Yo flashers- I'm trying to use buttons with the goto action to link to specified images within a frame. I'd like to leave certain images apparent while opening new ones within the same movie. Currently I'm just jumping fro mframe to frame without leaving any apparent. Do I need to use variables?
Keeping A Graphic Always On Top Of Dup MCs
Does anyone know how this can be done: a moving movie clip is duplicated and flies over an object, but the object sets itself over that movie clip or any other dynamically created movie clip for that matter. The answer to this problem could mean great implications!!(Ok, it's not great. But the information would still be nice)
Keeping A MC Halfway Between 2 Other MCs
Heya,
i have a dynamic text box [dis] that displays the distance between 2 movie clips.
x = (_root.arrow._x)-(_root.target._x);
y = (_root.arrow._y)-(_root.target._y);
distance = Math.floor(Math.sqrt ((x*x)+(y*y)));
_root.dis.dis = distance;
works great. what i want to do is position it EXACTLY between the 2 MCs and stay there. so it'll move and stay half the distance between the MC's all the time.
lil help pls?
FK
Keeping SWF In Html?
Hello,
I was wondering. Is there anyway to keep users from accessing the swf directly and keep them using the html page?
like mymovie.html instead of them going right to movie.swf
thanks
Keeping A M/c In Its Own Scene
thanks for suggestions so far on this but...still no luck
im creating a website authored only in flash to explore the worlds created by director tim burton...
but ive got a problem with my mars attacks! shoot-em-up game
when enter the game from the menu page all is ok, but when i try to link back at the end of the game, the flying saucers (that are randomly generated within a movie clip)continue across the screen when i go back to my menu page...i used 'stopallsounds' that stops all the game sounds okay...but is there a similar function to stop movie clips?
theyve invaded all my scenes!...can anyone save me from these aliens in a independence day stylee!...or maybe just tell me the actionscript to keep this movie clip operating in its own scene!
ive tried the suggestion of 'removemovieclip', but i do not know how quite to imlement it...what goes in the brackets...is it the m/c instance name?, or a label?
or is there any other actionscript methods...im sure this is simpler than im making it sound!
thanks
phil
HELP KEEPING Sound OFF
ok..I am losing my mind... I have a buttons turning sound off and on... 2 buttons with 1 movieclip.. how the hell do I keep the sound off when switching to another scene? Or area of the stage.. when I click on something else..different button..turns back on... HELP plz!! It's a job.. and the only thing left to fix... please please.. I will buy u coffee... heee..
Keeping The Program Going
Very newbie question. I have created a movie that moves as your mouse moves-the same as http://www.yulia-nau.de . But my timeline ends when the movie clip ends. How do I keep them going as long as the user stays on the page?
Help In Keeping The Leading Zero
Hi,
I know that this is a fairly routine question and has prob'ly been answered dozens of times in the past (yes I did search, but didn't find anything), but...
How do I get AS to keep the leading zero in a number?
i.e. I want my counter to return 01,02,03... instead of 1,2,3...
I checked the methods of the Math function and nothing rang a bell.
Thanks to anyone who can help.
Evan
Score-Keeping
let's say I have a simple Roullette game. I am having trouble with scoring. I want the gasme to start with 500, then subtract a bet amount and add the win amount. I have tried this bu keep on running into a brick wall. Any Ideas.
Thanks
Harry
Keeping Image On Top
I am creating an image viewer where all of the images (actually buttons) are spread out but almost touching each other on the same layer. I want to make the images expand as you mouse over them but here is the issue, once the image expands there is part of another image is overlapping.
My question is: Is there a way to setup buttons so the one selected is always on top with actionscript?
Keeping Variables
Hi, I'm sending a string to a dynamic text box. It works fine, but when I go to a new page with the same swf in it the varaible i just set is gone. Any ideas how I can keep the variable in the swf even if the page gets refreshed?
window.document.movie.SetVariable("test", sendText);
Thanks
Keeping HTML
How do you retain .HTML and JavaScript formatting when you publish in Flash. I want to be able to publish a Flash movie, open it in Dreamweaver, insert some HTML and JavaScript code and everytime I tweek something in Flash and then publish it again, I want that code to remain the same. Any ideas?
Keeping The CD Spinning?
I have a presentation cd that was made with Director that keeps the cd spinning the entire time so that when it loads video it does not need to spool up the cd. This cuts down on load time a lot.
Does anyone know of any tricks to get this to happen in Flash? Is it possible?
Thanks,
John
Keeping The URL Bar Clean...
Hi,
I'm wondering, how do some people keep the URL-address bar clean? By this, I mean that even if the actual address was www.mywebsite.com/folder/folder/something.htm, I'd still want the address bar to show www.mywebsite.com.
I've seen this on a few websites... ideas on how to do this anyone?
Qasim.
Keeping It Centered....
I'm working with a table and I want it to always stay at the center of the html page. How can i do that?
If I'm changeing the size of the window the table should still remain in the center.
Keeping Things Even
Hello all,
Iv been working on my site and iv ran into a problem. Im making it so that my main box resizes and the menu box stays in the left cover even with the main box but about 5 pixels away. Now when I tell the main box to resize it does it only the menu box has not stayed in the same place (even with the left top corner of the main box). Iv been using this actionscript:
ActionScript:
Code:
onClipEvent (enterFrame) {
disMenWin = 0;
_root.menu._Y = _root.window._Y+(_root.window._width/-3.1)+disMenWin;
_root.menu._X = _root.window._X+(_root.window._width/-1.3)+disMenWin;
}
Can some one help me with this? I really need this fixed for my site. Otradesign has a model of the menu and box movement that I want only that the menu would stay in the same place as the main box on the y axis.
NOTE I know how to make the box resize just need to know how to make the menu box and resizing box stay in the say place (menu box stays the same distance away and place from the main box as it resizes). Thanks in advance.
Keeping Track?
Okay, sooooo, here's my new problem ^_^;; (Thanks very much for the help before, by the way, it worked perfect!) I need something to keep track of how many times something gets hit. Like.... Object 1 hits object 2, a "you got hit" screen comes up and some sort of counter increases. When the counter gets to three, you lose. So, it goes to a "game over" screen. How does one accomplish this? ^_^;;
Thanks,
Ali
Score Keeping
Ok, I am using Flash MX 2004 and am making a game. I have been worknig steadily at it for about two weeks now. I have a lot of it done so far but still have a lot to go. The game I have made is just a basic car going down the street and other cars come at it and you have to avoid them. I plan to get more elabrate in the futre. But I was wondering if i could somehow make it so that i could keep score as the cars movie clip was ontop of the street's movie clip I could make it keep score. I would make it like add 30 or 40 points to the score every second you stayed alive. And maby even have a top 10 list somehow. Well If you can help me or have any other sugestions with my game please post them. P.S. i know have menu spelled wrong in the game just didnt make a new button yet. P.P.S. I am only 16 and am doin this for fun.
The .fla file i tried to attach is to large so ill just give you the action scripting for the road frame:
stop();
me_mc.startDrag(true);
obstacle_array = new Array();
obstacle_array[0] = obstacle0_mc;
obstacle_array[1] = obstacle1_mc;
obstacle_array[2] = obstacle2_mc;
function createObstacles() {
obstacle_array = new Array();
for (i=0; i<3; i++) {
obstacle_array[i] = _level0["obstacle"+i+"_mc"];
}
}
function testCollision() {
for (i=0; i<obstacle_array.length; i++) {
if (me_mc.hitTest(obstacle_array[i])) {
gotoAndPlay(3);
}
}
}
function createSpeeds() {
speed_array = new Array();
for (i=0; i<obstacle_array.length; i++) {
speed_array[i] = 10+15*Math.random();
}
}
function moveObstacles() {
for (i=0; i<obstacle_array.length; i++) {
obstacle_array[i]._y += speed_array[i];
if (obstacle_array[i]._y>Stage.height) {
obstacle_array[i]._y = 0;
speed_array[i] = 5+10*Math.random();
}
}
}
createObstacles();
createSpeeds();
_level0.onEnterFrame = function() {
moveObstacles();
testCollision();
};
Keeping Quality Set On Low...
ok here is a picture so you can see what i am talking about...
ok the top one is when it tests in flash mx.. this is what i want... on the first frame i have _quality="low"; and it works perfectly because the movie clip runs on low... which is what i want... then when i export the movie and run it it looks like the bottom one which is not what i want, as you can see the text gets jagged and the diagnoal lines get cut... when i run the exported it runs on low quality, but looks like its in high? If anyone can please help me thankyou so much!
Keeping Score
Say I have 15 different pieces(button) in one MC. If user clicks on one piece it should show the number of clicks. When all the pieces are done it should go to next frame or scene where it may show Game Over text. How to do that?
Any help will be appriciated!
Keeping Res High
I am working on a movie that will be placed on the timeline in scene 1. The movie contains simple movement and the images within movie look great, however; when I place the movie onto the scene 1 timeline the graphics look very pixellated when the movie is tested. I made sure that settings are set to the highest settings possible.
Could someone tell me what I am doing wrong?
|