ActionScript 2.0 :: Map Pan, Setting Limits To Image?
Dec 3, 2006
hey I have a large map in an mc and navigation buttons to control the map.
2 questions:
1.Does anyone know how to set limits on this? my image is w2200 h2980? stage is 1000w x 740h I am using code like this? Th buttons are either 1 or a 0 so i think the limit function needs to be in this section.
2. does anyone know how to adjust the script for zoom so that the image will zoom in n out without refocusing on a specific point. my large map move to a specific location as it zooms. it would be cooler if the the map zoomed in and out based on current location.
I have multiple applications, and need to set different connection limits for each of them - e.g., 10, 35, etc.I'm only concerned with limiting RTMP connections, and not using Apache or http streaming.
I need to set limits when generating a random number and this (code below) is just a temporary fix until I can set this limit dynamically.
The number is set to be between (0-4) by running an IF statement which sets a fixed upper limit. This works but I need the limit to update dynamically. My main goal is to use the numChildren property of an XMLList object (passed as argument) to set the maximum limit since the random number will be used by a loader when loading an image from this same XMLList.
Currently there are only 5 images in the XML file so this IF statement works. I would like to have the maximum limit update dynamically when the XML file has images added or subtracted to/from it.
I have a row of thumbnails (populated from an XML list). If you press the arrow, the thumbnails will scroll from the right or left. What I can't figure out is how to set a limit because right now if you continue to press the right or left arrow, the thumbnails will scroll off the stage.
So I'm making a simple counter to be used to keep a tally of 10 different categories, plus a total tally of all 10 categories combined. there are 10 buttons and 11 dynamic text fields. When each button is clicked, it will add to the text field that relates to it, plus add to the "total score" tally. I've got all of the buttons working correctly as of now.
However, I would like to set a limit on the total tally at 100 and am unsure how to do so right now.
I also have not been able to program a reset button correctly. I can make the text boxes revert back to 0, but it seems flash is still keeping the total tally because when I start counting again, the scores start where they left off.
Is there a way to set up a background image (repeating or non-repeating) that the stage area floats over. When I use file > publish settings > HTML > publish - It creates the HTML document but any area outside the stage is colored with the default stage color- Can this be set up in Flash or changed in HTML?
I have a question about setting up an image array from an external source. I have the following action script and would like to edit it so that it reads from an external file. Either TXT or XML. how to edit the array action.
How can a set the image size in the above code. I've tried inserting width and height parameters just after the image's path but an error is thrown. I would like for the image's width to be as wide as the dynmic text infoBox.informationText
Also the path to each image equals a variable called calledMarkerContent How could I set the img src equal to the variable called calledMarkerContent?
I'm having trouble setting up a Graphic object (a solid filled rectangle) to be masked with an image that gets loaded at runtime. I've managed to get it to work with the following code:
Setting the PNG inside the <s:mask> makes the stage render nothing, while adding the mask programmatically in the init() method causes correct behaviour. It took me quite a while to figure this out and I'd like to understand what it is that I'm doing incorrectly in the MXML approach, as that seems to be what is being done in the Cookbook (other than me using an Image and the example using a Group wrapped BitmapImage).
I've a slider class (SliderUI) and I'm passing slider and track images to that class as sprites.
What I'm trying to do is, passing one more image as sprite and changing its width for doing masking in slider. (It will expand or collapse as you move volume slider)
When I try to change width of sprite, it doesn't show up and I guess sprite is just container and resizing it makes it disappeared.
So how can I resize sprite with its child image (it's loaded by a Loader object by the way)?
I'm pulling in a xml-file with just one result in it. One of the nodes is picture, which contains a link to a picture. This is the xml-file:
<artist> <id>502</id> <name>Bad Religion</name>
[Code]....
I've tested the url, and it's correct. This is how I try to bind the url to the image instance (artistPic), but it's not working. Displaying the artist name does work.
var artist:XMLList = new XMLList(event.result); artistPic.source = artist.picture; lblArtistName.text = artist.name;
I want to load an image from a ByteArray and then set the dimension of the image. I'm doing it in the following way.
var img:Image = new Image() img.load(byteArray); img.width = 200; img.height = 200;
The problem is that if my original image is for example 90x100, I would get displayed an image of 180x200. It seems it cannot modify the proportion of the image! How can I instead obtain a 200x200 image?
I have a script which dictates alpha on rollout and onroll but I want to set a default alpha setting for images which are loaded via xml. Here's a tidbit:
[Code]...
I've tried combinations of tn_group["tn"+i].tn_button.tn_pic._alpha = 85; and such but I'm still a big newbie
I've got an image slideshow, and a preloader for each individual image. I want the preloader BAR to be dynamically assigned the width of the banner, which is defined in a variable. Here are my preloader settings and function call:
Basically, what is happening is. The "progressBar" width is being defined as the variable BANNER_WIDTH, but when the _xscale property is run in my preloading function, it doesn't care what the banner width is. So what I want to say is. I want you to _xscale according to what is being loaded, but I don't want your _xscale to exceed BANNER_WIDTH's width. I don't know how to do this and keep the preloader accurate. I can only save as CS4, CS5.
I'm using a very wide object in Flash CS3, and I didn't have a problem with the pasteboard automatically expanding to contain it in Flash 8 Pro, but apparently CS3 has limits as to how far it'll let the pasteboard expand, -2880 px to 3620 px or thereabouts. This means I have to move my object off of x:0 y:0 to work with it. This won't kill me, but it does seem to be a step down from Flash 8. Anyone have any news on why this change was made, and if there's any way to correct it?
I am doing an animation with a movie clip that needs to follow the mouse on the Y axis only smoothly and needs to stay inside a fixed dimension. (e.g. the mc could moves 200px left or 200px right maximum) And I want it to stop smoothly too when it reach the limits.
1)i dont know how to make limits! ... and what i mean by that ... for example ... how to make a car unable to move on the buildings ?or how to make the a car dont fall out of the screen ?
2) i also need something ? .. what is the function that could make the screen Zoom In , or Zoom out ??
3) also i wants to know ... how to make the screen Move like to make a car in the middle of the screen and moves as it moves ?
ive seen in a few places were pressing a button drops down a menu, which extends outside the size of the flash movie. So that it goes over whatever text is actually underneath the movie. Ive tried to do the same by just making the menu go below the movie, but that just gets cut off
ive seen in a few places were pressing a button drops down a menu, which extends outside the size of the flash movie. So that it goes over whatever text is actually underneath the movie. Ive tried to do the same by just making the menu go below the movie, but that just gets cut off
I am doing an animation with a movie clip that needs to follow the mouse on the Y axis only smoothly and needs to stay inside a fixed dimension. (e.g. the mc could moves 200px left or 200px right maximum) And I want it to stop smoothly too when it reach the limits.
If we have a Bitamp with more than 16777216 pixels (or one side larger than 8191 px) Flash 10 doesn't show it (Flash 9 and earlier has smaller limits even).One solution to this is to use scrollRect to limit the size displayed.OK, that works.
But Flash 10 has another problem, if we use any 3D property (rotationX, z, etc), flash transforms your MC in bitmap, so we can reach the above limit even when we are not working with bitmaps...A bigger problem is that although our MC could be really small (at least less than 16777216 pixels), when we apply a 3D transform like rotationX, the displayed MC can grows enough to reach the limit. And... we can't use scrollRect with 3D MC. But we have a trick here too, there are two ways to use scrollRect with 3D:
1. Create a 2D parent, then create the 3D displayObject inside of that parent. 2. Set cacheAsBitmap to true for the 2D parent. 3. Create a grandparent container to hold the first two items. 4. Set cacheAsBitmap to true for the grandparent container. 5. Apply scrollRect to the grandparent container.
These methods are really differents, with the second I couldn't use scrollRect to avoid reaching the bitmap limit. I think that's because in the second we apply scrollRect to the parent and 3D to the child, so nothing breakes our child from growing.With the firs method we apply scrollRect to the child, and the 3D property to the parent.
Code: var p: Sprite = new Sprite(); var c: Sprite = new Sprite(); p.addChild(c);
I am doing an animation with a movie clip that needs to follow the mouse on the Y axis only smoothly and needs to stay inside a fixed dimension. (e.g. the mc could moves 200px left or 200px right maximum) And I want it to stop smoothly too when it reach the limits.
I am making a SUDOKU generator(ActionScript2.0), which would (for now) generate the full and correct sudoku table. To do that I need to use recursive functions for calculating all the possible values. The problem is that when I try to run my program I get this error :
Code:
256 levels of recursion were exceeded in one action list.
This is probably an infinite loop.
Further execution of actions has been disabled in this movie.Is it possible to somehow work around this limitation?
Im using the code below to stop a page being moved past certain points when at 25% zoom on my page. This works perfectly however I have 50%, 75% and 100% zoom aswell. How would I alter this code so the drag limits can be different for each level of zoom.The code im using just now is:
pages.onMouseDown = function () { // check if page is zoomed if (pages._xscale != 25) {
I often need to divide quantities in recipes. Normally, this is straightforward: I have an array of items to divide and a total, so I can do something like
[Code]...
However, this time I have been handed a curve ball: some of the items have a maximum amount they can be. For example, item A has a maximum amount of .25, item B is maximum of 1, the other items have no limits. So if the total amount is 3, and I am dividing it by 3 items I can't simply set each one's amount to 1 (as I normally would, as the code above does). I need to set the amount of A to .25 so there is still the .75 "left over" that I now need to apply evenly to the remaining items.
So that means the other 2 items B and C would be 1.375 each -- but, as I said above B also has a limit (of 1), so B would be 1 and C (no limits) would get the whole .75 remainder, and be 1.75. So A=.25, B= 1, C=1.75 for the total of 3. My question is, even conceptually, how would I approach a problem such as this in AS?
I'm been working on a large-scale Flash game for the past 13 months, and a few months ago I was encountering an error message when trying to export saying, "Error creating Flash movie. There was not enough memory available." Here is a screenshot <url...> This isn't due to large videos or photos in the file, it's because theres a huge amount of frame by frame animation, so I can't just reduce quality.
I was off of a crappy laptop so at first I just bought a new computer with tons of ram because I didn't realize the software was an issue. This did not change anything (though I can run flash with less lag).
Then, I decided to do as much optimizing as I could. After a few months, all opimization possible as been done, and I have reached the point where I get the error again.
Then, I decided to cut the main file up into smaller pieces and link them together. This worked, but now some individual pieces require too much memory and get the error.
I have a datagrid in Flex 4 with a NumericStepper as editor for a numeric value. I can set pre-defined maximum and minimum values for the NumericStepper, but I need to be able to have different limits for each row in the DataGrid. How can I do this?