Professional :: Required With Limiting StartDrag()?
Jul 26, 2010
Quite new still to AS3 so if someone can help me out, or point in the right direction,Stage size is set to 750 wide x 440 high and my hi res image is 1500 wide x 880 high. image is called mcImage.The hi res image on the stage that is scaled down to 50% on both X and Y axes.I have a zoom in button, a zoom out button and a reset button. All do pretty much what their name suggests.When you zoom in, it adjusts the Z axes of mcImage to make the image appear larger on the stage. So far so good.I then get the new co-ordinates of X and Y by using the localToGlobal feature and record them in a variable, passing them to the mouse Handler for the dragging of the image.The issue is, whatever I try in startDrag(); does not limit the size of the dragable image, nothing happens, though I am expecting it to allow me to drag the image around within it's boundary!I am sure that the code can be tidied up, but I am still learning a lot about AS3 and trying my hardest.
[Code]...
View 6 Replies
Similar Posts:
Feb 11, 2011
i have an .as class that extends mx.containers.Canvas (it's a draggable border of a resizable component), it becomes draggable on MOUSE_DOWN and stops being draggable on MOUSE_UP, MOUSE_OUT and ROLL_OUT. before calling startDrag() i create a Rectangle to define the drag area, i also have a _dragging: Boolean variable to control if it's draggable at the moment. the problem is that when i click this border it jumps to a negative coordinate without calling startDrag or switching _dragging to true.
i've overriden get x, set x, get y, set y and move() methods in order to solve it but the only thing i got was the fact that position changes without calling coords setters or move(), but at the moment it's changed a getter is called and returns new (negative) value so my question is what happens on startDrag() and how to filter unwanted incoming coords values?
View 3 Replies
Jun 9, 2011
I want to add the required information to the 'Summary' tab when looking at the properties of an SWF file.Could somebody tell me how to do add the required informations .
View 5 Replies
Sep 13, 2011
I have a XML schema.I want to read only table tag and its geometery tag using action script3 code.Any Idea.
<table name="TableBase 1" id="TableBase3010" overflow="false" direction="lr-tb" suppress-empty-lines="false">
<style-ref name="default"/>
<geometry size="absolute" position="absolute">
<location left="117" top="102"/>
[code]....
View 2 Replies
May 19, 2011
as you can see, I have a container MC which I have added to the stage. I set its drag constraints using a Rectangle(). I then add the 'cat' child movieclip to the container, and I want this to be dragable too. However, as soon as I click on my cat when testing the MC. It shoots to point x=0 y=0 on the stage and doesn't move.
The container MC can be moved without any trouble.
If I remove the rectangle bounds from the containers startdrag() function. both MC's can be dragged without any issue.
//panning ability
my_x = 800 - myImage.width;
my_y = 480 - myImage.height;
[Code]....
View 3 Replies
Nov 11, 2010
I have a movie that consists of one image that scrolls across the screen. It all works beautifully. Although it's one image (jpeg) that has been saved as a movie clip, the single image is actually made up of a number of logos. What I want to do is to make each of those logos a separate hyperlink that will link to different external URLs. As the logos scroll across the screen, you can pick any one that happens to be showing at the time (the actual movie clip is larger than the stage) and then go to the relevant site.
If I save the jpeg as a button, I can't then make it scroll across the screen in the same way and I don't want to break up the image into indivdual files, as it will then not scroll as a single unit with the Actionscript that I'm using.
View 5 Replies
Feb 1, 2010
I have a few text based pages on a site i am trying to build which contain dynamic text (contained within a database, which can be changed from elsewhere). These are loaded into a dynamic text box of a fixed size that fits within my page. This all works great. I have created two scroll movieclips (which act as buttons, one for up, one for down) which when clicked cause the textbox to scroll up or down as relevant. These work fine as well. The problem i'm having is I only want the scroll buttons to appear if they are required (ie if the text within the text field is larger than its height so you need to scroll to read it all), but i cannot work out how to find the height of the actual content (as opposed to the height of the predefined dynamic text box). I can obviously create the textbox as autosized, then find it's height, then compare it to the desired height and (if it's larger) manually change it's height and display the scroll buttons, however i cannot imagine this is the most effective way to do it at all? I'm sure there is a standard, logical way to do this but i cannot seem to find any reference to it online or in the forums, but maybe because i'm searching for the wrong thing
View 3 Replies
Jun 10, 2010
We are using FlashLite 4 (Standalone player) supplied by BSquare in WinCE environment. In our product need to implement Action script extensions to communicate with C++ application. For this implementation we required ASextension classes supplying along with FlasLite Extension SDK. Is it available any evaluation version for FlasLite Extension SDK?
View 1 Replies
Jun 12, 2010
I'm using 64 bit Windows 7, I tried to download it on both Firefox and Google Chrome, I used the uninstaller on this site so I shouldn't have any current Flash installed. When I go to try and install the new flash 10.1, it tells me...."A required file (C:WindowsSysWOW64MacromedFlashNPSWF32.dll:5) could not be written due to insufficient permissions."
View 2 Replies
Dec 20, 2010
What modification required to use a "Class" code in .FLA itself instead of using an external Class file? When I tried the Class code by pasting all the code, it doesn't work. How to modify it? The following is the Class Code:
[Code]...
View 1 Replies
Feb 2, 2012
I am having issues with my install. Everything is fine until I push the INSTALL button and this screen pops up:
I have tried selecting all of those options just so that I can move on to the next part. If I hit cancel I just stay on the which items to install page. After it moves on and begins to install, the blue bar will run for a little bit, but then:
So any idea on how to get this to work? I open up the install program in the first place by right clicking on it and choosing 'run as admin' but this doesn't get me past this point.
View 1 Replies
Oct 27, 2009
I installed Flash CS4 a couple of days ago. Trying it out for the first time today. I went to import a video & got a message: "The required version of Adobe Media Encoder is not installed or the installation is damaged. Please reinstall."
I'm showing a Media Encoder CS4 folder under my Adobe folder, so I assume I've got the latest version installed, but it's a corrupt installation & I need to reinstall. My question is: do I need to redo the whole Flash CS4 installation? The reason I ask is that our IT provided me with multiple files for the install - there's ADBEFLPRCS4Win_LS1.exe. That's for the main install. But there's also a ADOBEFLPRCS4Win_Cont_LS1.exe. That's the added content file. I don't want to uninstall/reinstall Flash if I don't have to. Does anybody know if Media Encoder installs from the main Flash installation file, or from the added content installation file?
View 1 Replies
Feb 25, 2011
I have this line of code, it's a part of a code that generates mcs at random X and Y, it worked when I wanted it to spawn everwhere, but now i want to limit the X to 200 - 430 this is the code for spawning on all 640 (1-640) pixels of the movie:
this._x = random(640);
i've tried (200-430) but it acts as 200 minus 430 and I end up with the X being 0 somehow
Edit: Never mind, I got it... Here's how: this._x = 200 + random(230);
View 1 Replies
Jul 24, 2009
Is there any way? I thought "maxChars" was promising until I learned it was only for inputting text to a textfield.The XML is coming into a dynamic text box. I need to cut it off at say 500 characters and add an ellipsis.
View 2 Replies
Jan 1, 2010
Im trying to create a scrolling image gallery that changes when one hits the button by tweening the images left and right and now I'm trying to find a simple way to limit their movements in AS3.
Currently the images scroll infinitely in either direction. Is there anyway to restrict their movements?
Code:
import fl.transitions.Tween;
import fl.transitions.easing.Regular;
RightArrow_Btn.addEventListener(MouseEvent.CLICK, scrollRight)
[Code]...
View 1 Replies
Jan 4, 2011
example im dragin one mc object. with as3 code, and when im draging i want to do next: now
if(400<mc.x<450) {trace("WIN DUDE XD")}[
how to make that interval ?!
every time when my mc is between 400 and 450 on x axis, to trace Win
View 2 Replies
Jun 14, 2006
My knowledge of actionscript is basic, at best. I'm trying to make some animations move randomly by following a very helpful tutorial posted on this site [URL].. And everything was going so well until I tried to use my own initiative to limit the width and height of the movement. This is when I realised that I haven't got a clue what I am doing!
View 10 Replies
Apr 6, 2010
I have a MC made up of 5 vertical images. I have buttons that control the y value of the MC to move it up and down so that you can scroll through the content. Everything works fine, except that I cannot figure out how to make the MC stop moving when it gets to the last image on either end. I assumed it would be something simple like adding a > or < condition in the button so it would stop working at the extremes, but I can't seem to get it to work.
my website to see what it is I am talking about. [URL].. Click on the "print work" link and you should see the MC and the buttons that control it.
View 3 Replies
Oct 24, 2002
I need to limit form data entry to once a day. I have created a login and a PHP script that writes variables to a txt file. However, I want to limit the users ability to enter data to the server date, so that they can only enter in data once per day. For example, a poll that allows a user base to vote once per day. I need to do it using Actionscript, PHP, CGI, or javascript.
View 2 Replies
Jul 28, 2009
I have an array collection that I would like to limit to say 100 items. I tried setting up a filter function where the return was:return (myAC.getItemIndex(item) > 100);but the value was always -1. For whatever reason it couldn't find the item, even though the item is definitely there.I'm able to do this with a while loop:while(myAC.length > 100) myAC.removeItemAt(100);
View 4 Replies
Oct 13, 2011
I want to know how to prevent the user from drawing outside my school board.
My board image sizes 709.15 X 499.5. So I thought of something like this...
if(stage.stageWidth <= 709)
But if my board image is being called as a variable on stage boardActiva it should be easier.
Here's the function that draws:
private function dibujar(e:MouseEvent){
trace(e.localY);
tizaActiva.x = e.stageX;
[Code].....
View 1 Replies
May 21, 2010
I was trying to produce an output of an array mixed up and limit the number. how that is done. Now need to incorporate into a quiz application which pulls in data via, XML, displays that, and shows the number of questions. So if 50 questions are in the XML file 50 questions will be displayed in the quiz. What I am trying to do is use the XML file as a question pool and randomly select say 30 questions out of the file to display. no luck so far, but I am making progress!
[Code]....
View 1 Replies
Apr 20, 2010
I have an Flash CS4 application which pulls in data (questions) via XML and randomizes them. Right now if there is 50 questions in the XML file, 50 questions are displayed and randomized in the application. I am trying to figure out how to limit the randomizing pool so that only 35 questions display(even when the XML file has 50 questions) or something like that. My current code which brings in the file and randomizes is below. The code is written in AS3, by someone else.[code]
View 1 Replies
Jan 2, 2007
I have a question that I would really love answered. I have put script on a button which will scale a movieclip in intervals when pressed by the viewer. My question is if there is a way to tell it to stop at a certain point? Here is the code on the zoom button.
Code:
on (press) {
bigscan1._xscale += 25;
[code].....
View 5 Replies
Feb 9, 2009
At one point in my script I'd like to check a MC for the number of children and limit this number to 3. For that I use this script:
Code:
if (container.numChildren > 3){
for (i = container.numChildren; i > 3; i--){
container.removeChild(container.getChildAt(i-1));
popError('Horizontal nur 3 Elemente!');
}
}
This somehow works fine if there are 4 or 5 children in the MovieClip, but as soon as there are 6 or more, it throws an Argument Error #2025 and does not remove anything. BTW it does not make difference if I use container.removeChildAt(i-1);
View 2 Replies
May 17, 2010
I have an Flash CS4 application which pulls in data (questions) via XML and randomizes them. Right now if there is 50 questions in the XML file, 50 questions are displayed and randomized in the application. I am trying to figure out how to limit the randomizing pool so that only 35 questions display(even when the XML file has 50 questions) or something like that. My current code which brings in the file and randomizes is below. The code is written in AS3, by someone else. this part of the code pulls in the XML data and randomizes.
Code: Select allpackage exam {
import flash.net.* //to create URLRequest and load XML file
import flash.events.* //for Load events
[code]....
View 7 Replies
Apr 20, 2011
I already know how to limit my input text to a number of characters, but how would I go about (if possible) making sure characters do not repeat? In other words, I have a ten character input text box and I want you to be able to type pretty much any character but only one of each.
Example:
AFKEIOPCNK
What I'm trying to eliminate is this:
AANHDKDDJI
If that isn't possible, I'd like to instead detect if there are repeated characters so I can just say "that's invalid".
View 2 Replies
Dec 12, 2008
I have confirmed this behavior in FMS 3.0.2 on Windows 2003, Vista, and Linux.
In prior versions of FMS if I had a publisher sending a live video feed to the server, then I could have subscribers connect to the server and set a bandwidth limit for them and the server would ensure that the subscribers only got as much bandwidth as I set for them. As of version 3, the server now ignores this limiting for live streams.
You can set a limit on the publisher which of course then limits the live stream that subscribers view, but that is not what I want. I want to have the publisher push a live stream at the quality I specify and then I need a way to give some subscribers a lower bandwidth version of that stream. This all worked fine in prior versions of FMS and I can't imagine this is intended behavior in version 3, but it seems like a major oversight.
The bug can be replicated by creating a simple flash app to stream live video to the server and then in a separate NetConnection, subscribe to that live stream and display it. Then on the server side, setup an application.onConnect to do a setBandwidthLimit on the subscriber and you can see that it is totally ignored. You get the full bandwidth stream even though the limit should be reduced for the subscriber.
View 22 Replies
Apr 21, 2009
Since I only need numbers, can I limit dynamically embedded fonts to only numerals, periods, dashes and special characters copied from the character map?
View 5 Replies
Jul 2, 2009
I need the ability to create a TextArea entity in a constrained area (i.e., it is located at x and y and is w pixels wide and h pixels high and have that never change.), containing a proportional width font. As such, no 'num char entry limit' strategy is feasible. They need to be able to fill the entire area, and if that means 1,000 period '.' characters, or 200 '#' or "W' characters, then so be it.
The two lines following this one consist of 30 periods followed by 30 Ws.
..............................
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
I cannot limit a user to 30 characters. They need to be limited by using a TextArea that will let itself be filled until full, and then refuse further input until space is created by removing existing content. I then need to print that TextArea _as rendered on the user's screen_. Any 'scrolled' lines would be unprintable, and therefore the user's entry must be limited BEFORE any scrolling occurs, or contrariwise, when scrolling occurs, the last entered content would need to be removed and the entity forced to un-scroll. I can program this. It won't be elegant, and in fact will be quite stupid, as any programming where a change event is called with each keystroke or paste and then conditions tested is inefficient, wasteful, and well.
View 3 Replies