ActionScript 3.0 :: Resizing Movieclip In A Restricted Area?
Jul 7, 2009
I have 2 moveclip called view_mc and restricted and button called btn_scale.
When the user click and drag btn_scale, it resizes the view_mc where the width and height of view_mc dosen't exceed the width and height/2 of restricted area.
I made that. But when view_mc reaches the width and height/2 of restricted area, I can't resize view_mc to be samller. (The btn_scale looks like it's disables and can't use it)
I think some logic is missing. I highlighted the code that is missing some logic.
var clickedX:Number;
var clickedY:Number;
var newScale:Number;
I have made a movieclip and gave the frame this actionscript:
------------------------------------------------------------ var keyListener:Object = new Object(); keyListener.onKeyDown = function() {[code]........
it moves fine and stuff but i was wondering how can i restrict the area in which the movieclip can actually move ? my flash file is 550px X 400px and i want to make it so that it can only move in 300px X 200px of the file if you understand ?
I am trying to make a brain anatomy game in flash CS3 and I am having some difficulty getting the buttons to respect certain proportions. Allow me to elaborate.
[URL]
And then I bring it into photoshop and make a different layer for each different structure (in the screenshot I only did it for one structure but you get the point)
[URL]
Now what I would like to do is import my .psd file into flash and make every layer a different button. But I don't know of a way to view layers of a .psd file in flash. But here's the bigger problem. As you can see, it makes the "clickable" area for the button a rectangle shape.
[URL]
Whereas I would like for it to be the shape of the specific structure. If the clickable area is a rectangle then there is an overlap onto other structures which is not at all ideal. Especially when I get into smaller structures. What I want is for the button to be exactly like the layer in photoshop.
I have two movieclips, one loads an image, I resize that mc and add it in a bigger movieclip which has to be resized too. My problem is that that the inner movieclip doesn't resize the way I want although I've tried many variants of the sequence of the commands. I've also taken into account something that I read that an empty mc resizes strangely but it didn't change anything.
that's the code:
loader_mc.x=0; loader_mc.y=0; cont_mc.x=1440;
[Code]....
red mc is the outer one but the sizes of the inner are not right it should be about one third of the outer but it's about two thirds. same with the height.
All I want is to be able to resize them independenlty. with the outter beeing bigger than the inner
I have two movieclips, one loads an image, I resize that mc and add it in a bigger movieclip which has to be resized too. My problem is that that the inner movieclip doesn't resize the way I want. I've also taken into account something that I read that an empty mc resizes strangely but it didn't change anything.
the size of the outer is right 1440x1000 but the sizes of the inner are not right it should be about one third of the outer but it's about two thirds. about same with the height.
All I want is to be able to resize them independenlty. with the outter beeing bigger than the inner. Or to be exact I want the the inner to fit exactly the height or the width of the outer depending on which site of the inner is bigger( for example if the inner's width is bigger than its height then the inner width gets as big as the outer's width and then inner's height gets resized according to its ratio) and furthermore to center it in the middle of the outer.
This is specific url blocking. function pageDomainCheckInit(event:Event):void { var url:String=stage.loaderInfo.url; var urlBeginninng:Number=url.indexOf(://)+3; var urlTermination:Number=url.indexOf(/,urlBeginninng); var pageDomain:String=url.substring(urlBeginninng,urlTermination); [Code] .....
I want to be able to pause and resume downloads in my flex application, but I get a RTE when trying to set the Range header.
Error #2096: The HTTP request header Range cannot be set via ActionScript.
I imagine there isn't going to be a work around client side, but expect there is a way you can get a server to change the name for the range header to something else...
I've written a function that restricts user input to just numbers (0-9,.) and stores the input in the associative array, userInput[]. It works but seems inefficient looping through the entire input text string to scrub out invalid characters. Anyone have suggestions for a more efficient approach? Note that a working solution must correctly process mouse or cursor key movements/edits within the input box.
Also, you can see I'm using the KeyboardEvent.KEY_UP event to trigger the processing. The docs seem to indicate TextEvent.TEXT_INPUT is really the proper event for this purpose. I started with TextEvent.TEXT_INPUT but found the event is triggered before the last key pressed is actually added to the instance. The result is that the function was always one characterbehind. Is there an easy way to get the current text in the input box, including the last key pressed, when processing TextEvent.TEXT_INPUT?
Looking for any help you might be able to give me with this one. Recently upgraded from Flash CS3 to Flash CS5 Pro. When I publish a movie produced exclusively with CS5, the resulting SWF will work everywhere but inside my company's highly restricted/locked down network. When I attempt to load the SWF in a browser from within the network, all I get is what appears to be the standard Flash preloader - the 5 little dots that crawl across the middle of the screen.
I've confirmed there's no IE version error, the machines have the newest version of Flash Player; the only difference is the network. What could be preventing the SWF from reaching the browser? Is there any esoteric publishing setting I can use in CS5 pro that I should try?
I have a restricted editable textfield in flash like this:
oField.restrict = "0-9";
To capture changes I attach this listener:
oField.onChanged = function(){ trace(1); };
Is there a listener to capture the event when a restricted character is entered (e.g. the event when the key "a" is pressed - the field does not change, so onChanged does not fire).
Does anybody know how to make a folder inaccessible by direct address yet accessible to a flash file within that domain? Consider the following scenario.[URL]
I am new to Actionscript 3 and i am making a basic flash site using CS4 and AS3.I need to have an image as my background that resizes whenever the window/browser is resized and that works perfectly. I also need to import another SWF to the stage as this contains the main body of the site, this SWF needs to be centered at all times on the stage even on a resize.I have pasted some code below as what i have working at the moment is the SWF gets imported, the background does scale and resize etc but the movieclip won't center when first launched and i just can't figure it out.[code]
I have a movieclip in an external swf, called menubg. In the library properties tab, it reports the size as 1024x768.I use an embed statement to pull the movieclip from the swf at compile time. It comes in just fine (as a Sprite since that seems to be the only way to instantiate an object from an external swf), you can see it without a hitch, but tracing out the size info does not return the same WxH as the original.Here's some code, and the trace outs
var mbg:Sprite=new wpa_menuBG; trace(mbg.width,mbg.height); // 1028.95 777.95 -- that's not right // the screen container[code]......
This works perfectly! My movieclip button takes up the whole stage but I don't want the whole stage to be my hit area (which right now it is). I was searching and I found this actionscript: hit._visible = false; this.hitArea = hit; The tutorial said to make another layer inside my MC, then add that code. But when I play my movie, I can still see my green square (which was supposed to be my hit area) and it does nothing!
I'm new to the forum my name is Chris. I'm currently working as a Graphic Artist for a company called TransTech Systems in Schenectady, NY [URL] I registered today Im trying to figure out. I need to disable the hit area of an object thats part of a movieclip button. Im trying to create a single image light box effect in which the blown up image closes when you mouse off the thumbnail. Here is a link to my movie [URL] If you click on the pic of the gauge you will see the image blows up, and the background fades to a transparent black for better contrast between the pic and the page. I need the background fade effect to not have a hit area otherwise the rollout action does not work.
Here I am trying to resize a movie clip which contains some dynamic text with scrollbar in a swf using mouse.I am able to resize the movie clip using "setProperty". But unable to control the behaviour of the scrollbar. when I am increasing the size of the movie clip the scrollbar should automatically disappear. But I am unable to do so.
I am searching all over google for an easy way to resize images but the problem I am having is that .x does not work .width does not work ._width does not work. ._x does not work. How can I do something as easy as changing the width height of a picture? I am loading the photo into a movie clip using the Loader class
var i = new Loader(); i.load(new URLRequest("a.jpg")); // here I try to write a code that will change the size of the image. photon.addChild(i); //photon is the name of the movie clip instance
And have tried. all of the codes mentioned above on both the actual movie clip instance and the loaded image on variable (i).
I have been working with actionscript 2 / xml for quite a while now and this is the first time I have come upon this one. I have one movieclip in the library that I attach using attachmovie for that generic "glassy" vista type look. Only thing is, when I resize it via actionscript, it resizes incorrectly. Flash ells me it's correct via trace, but it obviously isn't. If I delete the border line off of the movieclip, it resizes fine! I have the clip set to none for scale under the properties tab(with the line and fill selected). The line has a gradient but it does the same thing if solid. What I'm wondering is has anyone else run into this and have they found a workaround?
resizing a movieclip created with createEmptyMovieclip.I tried changing the property using setproperty,the result : no image shown at all.. i think i stting a property for a wrong movieclip.....
Code: addressVars= new LoadVars(); addressVars.load("http://localhost/test/flashmx_dbPassReturn.php"); addressVars.onLoad = function() {
I have a movie clip named "shapes" that I use as a pseudo-background for my .swf, I alter the color of the movieclip by using the following code; on (press) { var colorful = new Color("_root.shapes"); colorful.setRGB(0x003366); } So that each section of my site has a unique color. The problem is I want to publish this as fullscreen (Publish Settings, set Dimensions to "Percent" and Width and Height to 100). For this to look right I need the movieclip "shapes" to expand to 100%.
I am trying to re-size a movie clip which contains some dynamic text with scroll-bar in a swf using mouse. I am able to re-size the movie clip using "setProperty". But unable to control the behavior of the scroll-bar. When I am increasing the size of the movie clip the scroll-bar should automatically disappear.
Here is the link of the swf I am working on: [URL] Here is the code I have used for the resizer: if (this._x <= 20) { setProperty(_root.cont.frames, _width, 20); setProperty(this, _x, 20); } else { setProperty(_root.cont.frames, _width, this._x); [Code] .....
I am having problems with a MovieClip, basically it can be moved arround with the mouse and it is resizeable but when i move it arround or enlarge the movieclip (when its in a published format) i want to constrain it to an area such as 400 width by 400 height.Because at the moment you can drag or resize the movieclip ouside the whole frame, which i dont want. i want to constrain it to a set area.
I have a game where you click a button and I want a movieclip to be duplicated in a certain area which is a movie clip named swamp_mc.On the button I am writing:
What's the best way of resizing parent movieclip without affecting the children? I have a container movieclip that resizes depending on the stage, and when I add another movieclips to it they also resize, but I want them to keep the original size,
I creating a flash gallery(using flash first time) and found one problem. When i resize movieclip(container) it resize its children, so i could't resize them manualy to dimensions what i need. How i can disable resizing of children of movieclip?