Movie Clip Width Constraints
hey all - i'm making a flash movie with a hella long image (which i'm building as a movie clip). i'm planning on using scrollbars built into the file to scroll it, so i don't want to make the movie any wider. however, its longer than the allowable build space in flashMX... suggestions???? the image can't reallly be broken up into links, its very important that it scroll...thanks
FlashKit > Flash Help > Flash MX
Posted on: 02-05-2003, 07:11 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Movie Clip _x Control By Button Is Working But Needs _x Constraints
I have a movieclip thats position is controlled by a mcBack and mcNext buttons. Everytime the button is clicked the button moves 100 right and if the other button is clicked the movie clip moves the other direction 100. This all works fine but I need the movie clip to stop when it it reaches -1928 in one direction and 0 in the other direction. Can anyone help me? Here is the code that makes the timeline move on the stage.
PHP Code:
mcBack.onPress = function(){
mc_timeline._x += 100;
}
mcNext.onPress = function(){
mc_timeline._x -= 100;
}
LoadMovie Width Constraints
Hello people,
I'm new to the forum and want to extend greetings.
I have a problem, and I know I am overlooking the obvious so I am prepared to slap myself afterwards.
I am loading swf A into a mc within swf B.
loadMovie(dir/A.swf,target_mc);
How do I constrain the width of A so it is its' normal size?
It wants to span the width of swf B.
I tried adding "_width=470" but my syntax is not right and/or working.
I am using Pro 8
Any help will be greatly appreciated!
Thanks ahead of time,
S1phrX
"Just another FLASHing boob!"
[CS3] Creating New Pop Up Window With Height And Width Constraints.
Hi,
I would really like to know how to create a pop up window where the height and width are set which all sounds easy enough and i actually could manage that BUT i am trying to input it into an already made script.
It is a XSPF music player located here and if you have a look at the examples on the page, i would like the button that says link (shows up under the picture when you click on a track) to be directed to a new window that is set to a specific height and width and pref with no toolbars or anything.
I think i have located the correct bit of code to edit but am not sure how to inplement it. The code is this:
//info button
if(playlist_array[track_index].info!=undefined){
info_mc._visible = true;
info_mc.info_btn.onPress = function(){
getURL(playlist_array[track_index].info,"_blank")
}
}else{
info_mc._visible = false;
}
I have tried a few things but i'm not competent enough with flash to know how to edit it properly and know what to change etc.
Hope someone can help
Internal Clip Width Bigger Than Movie Width?
i have a movie that is 750 pixels wide. i have a movieclip inside this main movie called "menuBack" that is just a bit less wide than the main movie. this movieclip has several other clips inside of it. i set a variable on a keyframe in my main movie getting the width property of "menuback". of course i expected it to be just a bit less wide than my main movie, maybe 720 pixels wide. when i test the movie and then check debug/list variables, it say it is 1095 pixels wide...how is this possible?
flash 5 btw...
Loaded Clip Constraints
I have some code that loads a movie to a certain area on my stage. Unfortunately though, the movie is un contained.
By that, I mean that things that are supposed to be off stage (invisible) are visible. Is there a way to foce the loaded clip to only show what is on the stage of the loaded clip?
As it stands right now, the clip i have is 250px by 20px
i have text swinging in from the right and exiting left. instead of seeing the textonly on the stage area of the MC i can see it to the right of the mc stage area (over my parent stage) and when it leaves, it just continues to move off the mc stage and over my parent stage.
PLEASE! anyone HELP, (i have no more fingernails because of this!!!) Thanks
Loaded Clip Constraints
I have some code that loads a movie to a certain area on my stage. Unfortunately though, the movie is un contained.
By that, I mean that things that are supposed to be off stage (invisible) are visible. Is there a way to foce the loaded clip to only show what is on the stage of the loaded clip?
As it stands right now, the clip i have is 250px by 20px
i have text swinging in from the right and exiting left. instead of seeing the textonly on the stage area of the MC i can see it to the right of the mc stage area (over my parent stage) and when it leaves, it just continues to move off the mc stage and over my parent stage.
PLEASE! anyone HELP, (i have no more fingernails because of this!!!) Thanks
Movie Clip Width
I'm loading a .jpg file into an empty movie clip. When I get the height of the movie clip, it returns the correct value. When I get the width of the movie clip, it returns the value times ten. So if the jpg is 800 pixels wide, it returns 8000. Anyone know what could be causing this? Here's the code...
Frame 1 - Main Timeline:
Code:
firstLoad = true;
function loadImage() {
imageLoader.loadMovie("test3.jpg");
}
function moveImage(clipName) {
if(clipName._height > clipName._width) {
clipName._width = 100;
}
else {
clipName._width = 200;
}
}
loadImage();
And here's the actionscript on the empty movie clip:
Code:
onClipEvent(load) {
trace(_root.imageLoader._width);
if(!_root.firstLoad) {
_root.moveImage(this);
}
else {
_root.firstLoad = false;
}
}
Getting Movie Clip Width
OK, my turn for a question. Slightly deceptive title, but hey.
For my second creation in flash im going for something... well, just much better.
Im going to load external swf files externaly to reduce initial downloading times. And i've got me a cool border for them, which resizes itself based on the width of the movie and such, and expands and contracts on mouse over/out. Its all very nice.
But, rather than having these windows in static locations, i thought, what if they where randomly placed? So i did that, and it works. I of course need the width of the movie clip so i can make sure it doesn't go off the edge of the screen.
I'm currently putting the code into one easy to use function. But the problem occurs, that as soon as you call loadMovie() then ask for the width, you get 0.
I need to ask for the width on the next frame, but, with it being in a function, it can't really wait until the next frame, so what can i do?
Getting A Movie Clip's Width
I'm building a wallpaper photo gallery. There are clickable thumbnails across the bottom with a hand-made scrollbar system that slides the thumbs right and left.
The thumbnails are dynamically loaded from external URLs using the Movie Clip Loader API. I load them one at a time and position them nicely side by side. Let's say each thumb is 100 pixels wide and I'm not using any margins between them.
The problem is, I have a couple different sets of thumbnails. When one loads, it replaces the previous set. But when I load a set with 15 thumbnails, then load a set with 10 thumbnails, the width of the container movie clip that holds the thumbs REMAINS at the 15 thumb size. So say 15 thumbs are 1500px wide, and 10 thumbs are 1000px wide. I load the 15 thumb set, wait a second, then load the 10 thumb set, and my scrollbar still thinks the container is 1500px wide.
This isn't a problem with getting the new width. If I load the small set first, then the big set, it resizes correctly to fit everything. It's almost like there's an artifact of the larger set that's forcing the width.
Here's how I empty out the container clip before loading a new set:
// Clear out the previous images
for (myname in _root.wallpaperChooser.thumbs.thumbsContainer) {
removeMovieClip(_root.wallpaperChooser.thumbs.thum bsContainer[myname]);
}
That should clear out every single object inside thumbsContainer right?
I've tried setting the width to zero after doing that, but then the newly added clips don't seem to force the width to expand.
Is there anything I can do to force the movie clip to take on the width of its inner elements? Other than calculate the width of all the thumbnails and set it manually to that value (I've tried this but everything seems to get squashed, maybe because of the artifacts from the previous set)? Or is there anything I'm missing?
Thanks!
Width Of Duplicated Movie Clip
Can anyone see why I can't get the width of the copied movie clip ??
Code:
duplicateMovieClip("char", "char" add i, i);
set("char" add i add "/letter:char", substring(text, i, 1));
//
thewidth=["char"+i]._width;
//
trace("thewidth="+thewidth);
Thanks
Gareth
Setting The Width Of Movie Clip
What I have is a movie clip with dynamic text field within
and what I wanna to happen is that when certain text is loaded inside that text field, the width of the movie clip is adjusted or setjust enough to show all the characters inside the text field!
Can it be done?
Check Width Of Movie Clip?
Hi guys, i have a health bar of 100pixels called mc, and a button. When the button is clicked, the health bar decreases by 10 pixels. However i want it to go to frame 2 if there is no health, and want the width to be constantly displayed in a text box. The code i have so far is:
on(release){
_root.mc._width=_root.mc._width-10;
}
Thanks alot, Dave.
Browser Width Movie Clip In As3?
Basically I want to make some flash which I am going to import into dreamweaver. The flash I am making needs to be as wide as the users screen. So basically i need to make my stage width the same as either screen resolution, or browser sizer, and then put my bar going full width of stage. What is the code for making the stage same width as screen?
Movie Clip WIDTH Undefined
I am having trouble with my AS for my image gallery component I am developing.
1. I am loading images (using a loop of the XML element) into a movie clip in frame 1.
2. I am then trying to trace the width of this movie clip in frame 2 (the reason I am doing this is because I remember someone saying something about the mc_width not being recognized until one frame later - even though other properties like _xscale work instantly).
3. I still get UNDEFINED in the debug window for the trace
WHY WHY WHY ?????
Hope someone can help.
Regards
Alex
Check Movie Clip Width?
Hi guys, i have a health bar of 100pixels called mc, and a button. When the button is clicked, the health bar decreases by 10 pixels. However i want it to go to frame 2 if there is no health, and want the width to be constantly displayed in a text box. The code i have so far is:
on(release){
_root.mc._width=_root.mc._width-10;
}
Thanks alot, Dave.
Movie Clip -- Maximum Width?
I've created a movie clip that was 3500 pixels wide and worked fine. When I postition something past that using the properties bar to set x and y corrdinates it is there and appears in the final swf. But when I try to scroll movie clip fla past 3500 pxs it won't do so and the object is unclickable.
Obviously one can place objects beyond 3500 pxs but why won't the movie clip fla scroll there and let the object by manipulated?
Movie Clip Changes Width At Runtime
I have a movie clip on the stage. When I click on it, the info bar shows its width is 90px. When I test the movie and do a trace( mc._width ) it has a width of 97.1 .... any clue how this could be happening?
Maximum Width Of Movie Clip?
So I'm having a little trouble with a project. I'm creating a portfolio that contains these very wide images that I have a little horizontal dragger for. I am having two problems with it.
Here is the file (I promise to leave this on the server as it is so that future people can also get help from this post): http://www.whosyourstudio.com/scroll/TCmoon1test.html
Problem #1: It doesn't load with the left edge of the image at the left edge of the document, as I have it set up in the flash file. I can't think of a reason for this to happen.
Problem #2: It doesn't scroll all the way across the image. It appears that the image is too wide for Flash to process. Is there such a thing? Here is the original image file: http://www.whosyourstudio.com/scroll/moon1.jpg
I have also posted the Flash file so you can poke around in it: http://www.whosyourstudio.com/scroll/TCmoon1test.fla
Sorry, I code the old way, so it's not all sitting on the frames. You will find the actionscript on the page by clicking on the main image, the little black line, and the draggable star. There is also some code on the button within the draggable star's movie clip .
Movie Clip Width 100% Centred
Morning everyone,
I'm having a problem with AS3...I want to have a movie clip that spans the width of the browser window which is centered so if the browser is scaled the content in the center remains the same size but the left and right expands.
In css it would be a little like adding margin:auto to a div tag.
Ideally it would be great to load in various external swf files for different sections that images txt etc are able to move in from the edge of the screen.
This sort of thing http://www.elmwood-design.com.au
Does anyone know of a tutorial or post that may shed some light on this. Still quite a green with AS3.
Cheers
Need To Get Width Of Empty Movie Clip
Hi~
I searched but didn't find a clear answer, maybe someone out there has done this before.
I'm using the CreateEmptyMovieClip to import jpegs(my portfolio images) into my flash movie. I know how to position the first image using _x and _y. How do I position the second image so that it's to the right of the first one + 20 pixels?
Here's what I have so far. Anyone have any ideas?
________
this.createEmptyMovieClip("item1_mc", 10);
item1_mc.loadMovie("http://sonic-cow.com/doran/journal_01_02/images/diary%20pix/resE_01.jpg");
setProperty(this.item1_mc, _y, 20);
setProperty(this.item1_mc, _x, 20);
this.createEmptyMovieClip("item2_mc", this.getNextHighestDepth());
item2_mc.loadMovie("http://sonic-cow.com/doran/journal_01_02/images/diary%20pix/resE_02.jpg");
setProperty(this.item2_mc, _y, 25);
setProperty(this.item2_mc, _x, (item1_mc._x+item1_mc._width));
_______
thx in advance!
Doran
Movie / Image Size Constraints.
I am trying to build a system for map navigation, that will let the user both scroll and zoom on another image or movie clip. Seems easy enough, but am quickly running into a problem of the content getting too big. I haven't narrowed down the exact limit yet, but somewhere between 6000 and 10000 pixels, flash begins to introduce rendering errors when I scroll the image to the right past a certain point. Is there a documented limit somewhere on how big a movie clip or image can be resized? I know that movie clips can't be defined greater than 2500 pixels. Is it some multiple of that number? I know I can import images larger than that, but that still doesn't help me figure out where this limit (be it a bug, or feature) lies. Once you start zooming in on a clip of that size, it blows up pretty quickly.
So far I've been playing with the stock scrollPane component, and the Loader component. An alternate approach might be to build a component that loads the map at its native resolution, and then uses a scaled mask to establish a viewport on that map, which I would then resize to show the view.
My two issues then become:
1) How do I dynamically specify stage dimensions for a movie clip in order to create this viewport? Can you somehow use a clip mask to establish component dimensions?
2) Will I still run into scaling problems? Will flash scale the whole movieclip to fit in the parent clip that holds it, and then mask things off... or will it mask and then scale? It is my hope that the later could circumvent the rendering issues I'm running into.
I'm fairly new to flash, so I may be missing some fundamental concepts here. I'll also probably need to do some more research on building custom components, but I was hoping someone could give me some sage advice, or at least lead me in the right direction.
Thanks,
-paul
Setting Width And Height Of A Movie Clip
I want to dynamically load JPGs in to a movie; there are going to be 1000's of JPGs that vary in size. The JPG will load when the user selects which image to load and it will have a drop shadow (mc) that changes to the same dimensions as the loaded image, offset maybe 10 pixels.
I have started by creating an empty mc when the user clicks on a button. A JPG is then loaded into that mc. The drop shadow is a graphic symbol within an mc named 'shadow_mc'. This is initially set to not be visible, but becomes visible after loading the JPG. The code I am using is below:
----------------------------------------------------
on (press) {
_root.createEmptyMovieClip("holder", 1000);
holder.loadMovie("myPic.jpg");
_root.shadow_mc._visible = 1;
_root.holder._x = 10;
_root.holder._y = 10;
imageWidth = getProperty(_root.holder, _width);
imageHeight = getProperty(_root.holder, _height);
_root.shadow_mc._x = _root.holder._x + 10;
_root.shadow_mc._y = _root.holder._y + 10;
_root.shadow_mc._width = imageWidth;
_root.shadow_mc._height = imageHeight;
}
----------------------------------------------------
The problem comes when trying to set the properties of the 'shadow_mc'. Setting the x and y values is no problem and I can offset the mc that holds the drop shadow (+10). However when trying to match the drop shadow to the dimensions of the image I cannot get it to work.
First I tried:
_root.shadow_mc._width = _root.holder._width;
_root.shadow_mc._height = _root.holder._height;
but this did not work so I have used getProperty in the above code and assigned the results to variable names to try and set the shadow width and height to match, but still no luck. In fact when I use _width and _height the shadow cannot be seen at all.
Finally any other suggestions on how to approach this and I read that I should make sure the image is loaded before doing anything with it, how do I do that?
TIA,
Adrian.
Movie Clip Width Limit? PLEASE HELP A Girl Out.
okay,
I have a MC that i am dropping on the main timeline.
The problem is that I am out of space on the MC.
I kept placing objects to the right and scrolling over, well now flash won't scroll over any more. It just cuts off and i can't even drop an object over any farther. I am making an actual "timeline" (not a flash timeline, but rather representing one graphically)
How do i get the movie clip width to increase?
How can i solve this problem another way?
I have tried increasing the width of the movie, but all that does is make the stage on the main timeline bigger, and does nothing to the width of my movie clip.
thanx for any help you can give me!
Changing Height And Width Of A Movie Clip
I have a movie clip called user_avatar. This movie clip is just a blank movie clip used to load an image into it.
Here is the code I am using to load the image into the movie clip: (the photo loads in correctly)
user_avatar.loadMovie("chris.jpg");
I tried putting this under the above code
user_avatar._width = 24;
user_avatar._height = 24;
When I added these two lines the photo didnt load in anymore
Also I tried putting this code on the movie clip (user_avatar)
this._width = 24;
this._height = 24;
When I added these the photo loaded in but it didnt get resized
I basically want to resize the photo loaded into the movie clip to be 24 pixels wide * 24 pixels height. Hopefully it is possible...
Any help would be appreciated!
Adam
Dynamic Movie Clip Width Limit?
i'm building a crawl along the bottom of a screen that pulls data from an array and adds it to a dynamic text box. after that text box is built, it calculates the width of the text box, moves another copy of it to width+20 and adds at the text into it also, so that when the crawl ends, the other one is there to keep it constantly on screen.
the problem i'm running into is: it seems to work when the clip is 4000-5000 px long, but when i get it up to 12 or 15000 px wide, it starts freaking out. is there a limit to the size i can go or what?
scott
Finding The Width/height Of A Movie Clip
When importing bitmaps/jpgs/pngs etc is there a way to find the height and width of that image before it loads. in the preloading stage?
basically i want my preloader to be a black box the size of the image to be loaded?
Cheers
How To Determine Width Of Library Movie Clip
Hello,
Does anyone know if you can find out the width and height of a movieclip in the library (not an instance on the stage). I'm using the Window component and want a window to pop up at the correct size to accommodate the movieclip I'm loading from the library.
The only way I can see to do it is to create an empty movie clip on the stage (invisible), attach the movie clip from the library, get the width and height, and then use those figures to open the window. Is there an easier way?
With thanks,
Julia
Empty Movie Clip Width Problems
I'm trying to load images into a row of images. Each image is a different width. Heres the code so far:
ActionScript Code:
var xPos:Number = 0;for (y=0; y<5; y++) { var container:MovieClip = this.holder.createEmptyMovieClip("picholder"+y,y); container.loadMovie("mypic.jpg"); container._x = xPos; xPos += container._width;}
The problem at the moment is that the container._width property is reading 0 so all the images are loading on top of each other. This is the same with "picholder"+y. If I set the xPos value to say 100 then it works fine. I'm guessing its something to do with the fact that the loadMovie happens after the var container is defined. Whats a way around this?
Any help much appreciated
Also just while I'm posting whats the correct syntax for something like this:
container.loadMovie("mypic" + (y) +".jpg");
Hide Movie Clip's Real Width
I have one main movie clip "content" that contains evreything for my site. A script running on _level0 watches the width/height of this movie clip to keep it centered within the flash window.
Now, I have masks inside this "content" movie clip. These masks may be quite small (say 400px wide) yet they are revealing only small areas of much larger jpegs (maybe 2000px wide).
My problem is that the script running to center the "content" movie clip measures these massive jpegs that are hidden by the mask. I would like only the revealed portions to be centered within my movie.
Any ideas?
Cheers, James.
Dynamic Textbox Width - Positioning Movie Clip
Hi,
I have a dynamic text box which will display text of varying lengths. To the right of this I have a movie clip. I want to be able to set the x position of the movie clip as the x position where the text ends.
I assumed this would be easy:
_root.mc._x = _root.textBox._x + _root.textBox._width
The movie does move when I use this code but it doesn't move to the end of the text it positions itself within the bounds of the text box.
It looks like it is something to do with the textBox._width property but I am not sure what. Can anyone point me towards how to get the x position of the end of a text box? and also what exactly the textBox._width does.
Many Thanks
Finding The Width Of A JPEG Loaded Into A Movie Clip
I will be loading a page of bio information. Next to the person's photo (photos will vary in width) I want to put a column of buttons about 20 pixels to the right of the photo. So after I load the photo into an empty movie clip, I'm trying to get the width of the photo in order to figure out the x position of the buttons next to it. Here is what I have:
myImage = "images/" + _level0.images[link];
loadMovie(myImage,image_mc);
// JPEG loads okay into image_mc //
trace("image_mc._x = " + image_mc._x);
// I get "Image_mc._x = 393" as expected //
trace("myImage._width = " + myImage._width);
// I get "image_mc._width = undefined" //
trace("image_mc._width = " + image_mc._width);
// I get "image_mc._width = 0" //
How do I find the width of the loaded JPEG?
Problems Changing Height/width Of A Movie Clip
I have been working on this problem for hours and am close to getting it working but am starting to get very frustrated because I just can't get it to work....
I am trying to load an image into a empty movieclip and then resize that movie clip!
You can download my test file here: http://www.trackie.ca/resize_mc.zip
Here is a description of the .fla and what I am trying to do:
Here is the code in the action layer
ActionScript Code:
//Load the JPG image into the movie clip
user_avatar.loadMovie("garfield.jpg");
//Gets the percentage loaded
avatar_percent = Math.floor(user_avatar.getBytesLoaded()/user_avatar.getBytesTotal()*100);
// Waits until the Movie is loaded before changing the properties
if (avatar_percent eq "100") {
user_avatar._width = 80;
user_avatar._height = 80;
user_avatar._x = 0;
user_avatar._y = 0;
}
The 2nd Layer (named: loadClip) contains a blank movie clip with an instance name of user_avatar which is where the garfield.jpg image gets loaded.
The final Layer (named: percentage) just holds a dynamic text box with the variable name avatar_percent which holds the percentage loaded.
the file loads in fine but when I attempt to change the _width and/or _height of the user_avatar movie the image disapears... When I change the _x and _y it works fine.
Note: The file attached works perfect but I imported the jpg image myself into the movieclip (You will notice the user_avatar movieclip is not blank but has the image imported). But I dont want to manually import an image I want to load it into the flash file.
I hope someone can help me with this as it is driving me crazy...
Thanks
Adam
Loading JPG Dynamically Into Movie Clip--but Can't Find Height/width
I'm loading jpgs using this:
Code:
currentClip = createEmptyMovieClip(_global.arr_fileName[cID], 100);
currentClip.loadMovie("photos/thumbnails/" + _global.arr_fileName[cID]);
But currentClip._height and currentClip._width evaluates to 0...shouldn't the movie clip have the same height and width as the jpg?
Changing Height Of Movie Clip Without Changing Width
Im using flash MX, and i needed to know if it was possible to change the height of a movie clip without changing the width of it. i have a 1px wide line, and i want to change the height of it, but i want to keep it 1px wide. is it possible to do this without having to redraw it everytime i want to change it?
Measure Width Of A Growing Clip Before The Clip Is Executed
Hello there,
need some help here, please please please
I've got a movieclip which contains a "tracer" that draws dinamically a stroke on the scene by running on a motion guide.
I'would like to be able to measure dinamically the width of this clip before it's executed so I can duplicate offsetted instances of the clip and make this bunch of paths look like a single long long path.
I've got a code that looks something like this:
Code:
for (i=0; i<=N; i++) {
draw the clips in the correct order bla bla bla
}
If I do a
Code:
trace(getProperty(_root.mc_disegna, _width));
before the for cycle i get growing values each frame like
Code:
4
15
28
31
and when the first clip is fully executed I get the real full size
if I trace the same thing after the for cycle I get the real size (36) but then I can't use this correct measure to offset the other instances because I would like to pre declare this size.
I've been trying with getBounds and getRect but had no luck
[MX] Maximum Clip Width?
Hi,
I am trying to build a site using the navigation style more commonly known as "Barney's menu", (where the pages glide in from the side). Here's what I have so far:
http://www.neilhillman.com/barneys.htm
(The first 4 tabs work).
Source: http://www.neilhillman.com/barneys.fla
... but have reached a problem. All my pages need to be in one long horizontal clip so as to scroll along, but Flash MX doesn't seem to like clips that are more than 3x the width of the stage, it won't allow me to scroll further to edit, and I keep getting invalid positioning errors!
I have heard that the solution is to create all your pages as seperate movieclips, and then use actionscript to combine them all into one long clip, but I was hoping someone can show me how to do this?
Thanks!
Browser Constraints
I've been sitting around for nearly 2 days, trying to figure out how to constrain the size of the browser to no avail.
I was wondering if anyone can tell me how to?
I'm thinking it needs some code.
It's a bit hard for me to explain, but i'm talking about the broswer not being able to be streched, no nav bars or scroll bar, Just the TITLE bar and the close button are present.
if you still dont understand try
http://wme.cjb.net
skip the intro
the follow the big link
and a window should pop up that cant be modified
that is what im talking about....
cheers if anyone can help.......
plz im desperate
StartDrag Constraints
Hi - I'm trying to get a good, zoomable, draggable map compatible with Flash 4. I'm pretty close, but I want to constrain the drag to when the mouse cursor is within the viewable map area, and to stop dragging when the cursor is moved outside that area.
Part of the reason I want to do this is that it seems more useable (it's weird to be dragging something from a point that is hidden behind an object). The other reason is that, if a user drags outside the viewing area trying to get to the left side of the map, and releases the mouse over any of the buttons in my slider movie (there are lots of them) the stopDrag action isn't read and the map gets "stuck" to the cursor. I assume this is due to the on(dragOver) actions on many of these buttons, although I can't logically see why.
In the attached file, the drag is constrained using a startDrag action and the coordinates, but when the map is fully zoomed, this prevents the outer regions from being viewed.
Anyway, if you unzip these to a folder and export chesterfield.fla you'll see what I'm talking about. Thanks for taking a look at this!
M
Trailing X Y Constraints?
Is there a way to constrain X/Y Mouse Trailers to a certain Area???
So I can just have them over buttons etc instead of move around the entire movie?
Dragging With Constraints
Greetings to the reader,
For some kind of interactive art project I need to recreate some
kind of cheesy gun-interface with Actionscript, and for the trigger
I had the following in mind:
I want to be able to drag the trigger backwards (which will cause
it to rotate slightly around a pivot point, but not actually move),
but it must seem like there's a bit of friction (i.e.: it's not a
matter of dragging the mouse back and that's it, it must seem
like you need a bit more force to pull 'the metal of the trigger'
back) and when you reach a certain point the dragging won't go any
further and when you release the mouse button the trigger will
snap back.
Nice idea and all, but I've no idea how to do this, 'cause when I
want it to rotate, it won't stick to a pivot point and I'm having
a bit of trouble with dragging.
Anyone can be of assistance ? I'd appreciate it.
Rotation Constraints?
Ok, so heres what im trying to do: (i drew a sweet diagram :])
http://img233.imageshack.us/img233/82/rotationod6.jpg
the little blue crosshair rotates and points towards the mouse, but i want it not to rotate past the two red angles.
here is the code, but for some reason, its not working, and i dont know why
Code:
onClipEvent (enterFrame) {
radians = Math.atan2(_root._ymouse-this._y, _root._xmouse-this._x);
degrees = (radians/Math.PI)*180;
this._rotation = degrees;
if (this._rotation<=-160) {
this._rotation = -160;
}
if (this._rotation<=160) {
this._rotation = 160;
}
}
StartDrag And Constraints
Last edited by utoks : 2004-12-16 at 12:42.
So heres my little flash:
http://j.bluecloudstudio.com/map.html
Basically what it does right now is zoom in on a graphic and then go left and right by using startdrag and stopdrag.
But what i want it to do is when you zoom in some and then drag it to the left it should stop when the blue border is touching the end of the graphic. This way it will never pan all the way to the left where you see blank white space.
here is my fla's
http://j.bluecloudstudio.com/MAP.FLA
and the sliderbar.fla
http://j.bluecloudstudio.com/sliderbar.fla
i think that flash5's startdrag has constraint paramaters but i dont know how to make these stop the drag when the edge of the map graphic is touching the edge of hte blue border
(this was edited because it didnt make much sense-- sorry about that)
any help would be greatly appreciated.
my email is fjood@inmail.sk. Thanks!
Determining Width Of Loaded Clip
Hi all,
Is there a way I can get and set the width and height of a loaded movie clip? I have created an empty movie, and then loaded a small swf file into the empty movie with loadClip. I now want to determine the width and height of this loaded clip, and scale it to the size of my movie dimensions. Can this be done? Although the movie loads fine, and I can position its x and y coordinates, the width and height show as zero.
Can anyone help me with this one? I'm using Flash Professional 8.
Thanks,
brayne
Edited: 04/19/2007 at 09:31:58 PM by brrayne
Attachmovie Clip Width = 0, It Lies
Ok, I am attaching a movie, valled targetx it has a second clip inside it, called holder. I am using loadmovie to load an image or swf into the attachmovies holder clip. But, if I use trace(targetx.holder._width) to get the loaded clips width I get 0, which is cleary no correct. Why is this?
Scaling Clip To Stage Width
ActionScript Code:
box._x = 0;
box._xscale = Stage.width;
trace(box._width);
when i test the above script, my movie clip doesnt scale to the the stages width. Any thoughts?
|