ActionScript 2.0 :: Movement Using Loaded Data?
Sep 15, 2003i want a movie clip to move along my stage using coordinates loaded from an external file. is there a tutorial that shows how to do that
View 1 Repliesi want a movie clip to move along my stage using coordinates loaded from an external file. is there a tutorial that shows how to do that
View 1 RepliesI've been playing with carousel code, and was wondering how to change it from circular animation (carousel) to left/right linear (conveyer belt) style animation, how to change the mover code and 't.angle = i * ((Math.PI*2)/numOfItems);'
[Code]....
I have a mc (fStrip) which looks like a piece of filmstrip with thumbnail images in it. I want this mc to move when the users mouse is positioned over it, but I only want it to move only along it's x-axis and in a direction opposite that of the mouse. And I want it to move or flow smoothly.
I've been trying to figure this out (see my lame attempt below) but without much luck.
onClipEvent (mouseMove) {
buffer=20 //movement buffer
mousePos=_root.fStrip._xmouse //store mouse position
if (mymouse!=_root.fStrip._xmouse){ //if the mouse has moved
[Code].....
I wish to get the effect of ants scuttering across the screen or up a tree, I have not decided which direction yet. I started with the tutorial code for the snow effect from kirupa, and changed it around to fit the little vector ant I created. The way I have it now looks pretty good, but the movement is a little too fluid. They obviously move in sinusoidal paths bc the code tells them to. I have about 20 copies of the main obj, and they're all a little different in size and specs (speed, transparency, etc) but what I was wondering was if there is any way I can change the code to make it a little more hectic, or erratic, not so fluid. If there is no way of doing so, it looks pretty good right now. If there is, however, I think it could look awesome. here's the code I'm using for the object.
onClipEvent (load) {
//stage
movieWidth = 850;
movieHeight = 50;
[code]....
how to get the camera to move with a character? At the minute he just moves off screen when i press right rather than the camera following him.
View 3 RepliesI have a Mogli (Junglebook-like) Character that i got to move with the arrow keys on the keyboard.
I want the character to jump (so for example , he must while moving to the right of the "gamearea" , you must be able to hit a key (say for example the "control" key ) and then the character must jump ( go up ) and as soon as the key is released he must obviously come down.
And also how do one set movement speed on any particular movement.
I want to be able to get the ID3 data tags from the mp3 that has been loaded into the soundChannel. I cant see a problem as far as getting the data using trace, but how would I go about displaying this information on my flash document, in a specific location? The data I wanted to include was the title, artist, and the duration.
View 3 RepliesI have an AS3 application and I'm trying to implement an MVC framework.On the model's initialization, data is gathered about the user. When the user clicks a button, say to print their first name, I want to request and retrieve only that data from the model.I currently have the view listening for a button click. The button click is handled by the controller. The controller fires a "getUserFirstName" method in the model. I'm confused about this part...Since the controller and not the view is calling the method, I can't do a return of the user's first name in this method. Should I dispatch an update event? I'm not sure how to pass this data to the view in the most efficient way.
View 2 RepliesI have 2 swfs. One of them called "main.swf" and the other called "test.swf"
Main loads test using the code below
ActionScript Code:
//create loader and url request
var contentLoader:Loader = new Loader();
[Code]....
What I'm trying to do is to trace the x-coordinates of a Movieclip called "dot" inside test.swf.
But I keep getting the error: "1119: Access of possibly undefined property dot through a reference with static type flash.display:Loader."
How do I get the x coordinates?
I would like to sort the loaded data from a XML file by the "avg" data. To make a simple ranking system.
[Code]...
How can I send data to a loaded SWF? I just need to send some text from a few text fields.[code]...
View 1 Repliesswf file A gets loaded into swf file B. swf file A allows a user to sign up for a promotion which uses URLLoader to send data out to an external domain. the external domain has a crossdomain.xml file which does get loaded, but I continue to get Security Sandbox Errors.Is it allowed to send data from a loaded swf file (swf file A) to an external domain?
View 1 RepliesI have two classes: Level, which dictates a tile-based level, and MapLoader, which loads a text file on my local machine.I am calling a load function through Level asking MapLoader to load, but when I try to parse the data, MapLoader isn't done with the load.I've tried putting the load in a while loop, but it just freezes. Here's the MapLoader and the function in Level.[code]
View 5 Replies- I have an array of ~200 buttons. - Each button pulls individual info from a file online:
/routes/801/
/routes/802/
/routes/803/
...- My pseudocode looks something like this:
Code:
var myURLReq:URLRequest = new URLRequest("/routes/"+butNum);
var myURLLoader:URLLoader = new URLLoader();
myURLLoader.addEventListener(Event.COMPLETE, infoLoaded);
[Code]....
My problem is this: Let's say the user clicks 5 buttons. Since data doesn't load immediately, I can't assume infoLoaded is being called in the same sequence in which the user clicks the buttons, but I need to know which file just loaded. Is there a property I can get from ev:Event so it'll give me the URL I used to load myURLLoader?
I Am creating an image gallery and loading the images dynamically from a text file into empty movie clips which i am duplicating as needed. Thats ok so far.[code]...
View 2 RepliesI have just started with creating Drawing Pad, which can save and reload the image drawn once. I have completed the basic interface which includes drawing and erasing part. I am storing the co-ordinates in a text file. I am using MultiDimensional Array to store X,Y co-ordinates. But now I am facing a problem that how to load these variables into the flash back and using these redraw the image. I tried using 'loadvars', but it didn't helped me as it doesn't return string data. Can somebody help me in this so that I can load co-ordinates from text file and redraw the image.
View 4 RepliesI'm trying to load data from an external textfile, called "config_flash.txt". It works perfectly if applying the fetched data is done within the same function where the loading is done. However, I would like to use the fetched variables in other parts of the script.
Here's what works:
Actionscript Code:
var varLoader:URLLoader = new URLLoader(new URLRequest("config_flash.txt"));varLoader.addEventListener(Event.COMPLETE,
[code]...
So, basically I want the variables/values defined inside the function to be available anywhere in the script. The error that the second code snippet causes is as follows: "1120: Access of undefined property text1/text2".
Is it possible to access the properties of an image when it's been loaded in to an swf?
I am thinking of the properties which can be edited and displayed in the Windows directory listing.
The image 'contents' field could then be used as the caption for the image viewed in flash.
I am loading images from a mysql database. Lets say I was displaying 8 on a page, how can I tell how many pages I have and have it update when more images are added? Like on sites where they have links like
images 1-12 | 13-25 | 26-38 | 39-51 etc
if I load data into a swf file using URLLoader (such as an XML file of a CSV file from another website), everything works fine until I actually upload it to the internet using my cheap, wimpy, webhosting service. At which point none of the data is transferred. Is there possibly anything about security sandboxes that completely eludes me, or is this even an issue that deals with security sandboxes?
View 2 RepliesI'm attaching an MC to the timeline and within that attached MC is a LoadVars.sendAndLoad command. This works flawlessly when I have a few variables but becomes horribly bogged down when I have to send (and receive) lots of data. It actually freezes my swf until all the data is loaded, then switches windows <minimizes itself in Win XP> after it's all done loading. I need a way for the original attach movie to finish loading, before I send the PHP commands...
View 1 RepliesI got another XML gallery thrown at me this week and am thinking of adding a new feature.When a user clicks on a gallery it will load the first image, and continue to load all of the images so they won't have to wait each time they hit next, as it would be in their cache. this link has been thrown around a lot, but I don't think this feature (which is an awesome feature, oh yes) has been addressed. Goto one of the galleries and wait for it to load, and then keep hitting next. The pictures load before you get there. You can catch up to the unloaded ones and reach a loader bar if you hit next enough times
View 4 RepliesI'm facing one problem while reading an external xml file..my execution is going on before file loaded completely.
View 2 RepliesHere's my problem:I have a project with loads of text ergo I am loading textfrom external files with html formating. Now I have to insertvideos linked to the text file too (as in "dolor ipsum ... press here to view video"). All I need is a code that lets my textinteract somehow with the movie.Can I do it somehow through Javascript/Coldfusion/anything ordo I have to scrap my text and make things manually ?
View 5 RepliesI want to load an image using XML and have that image be a button.
View 2 RepliesI'm pulling around 200 records from a mysql.1. What should I do to make the dynamic text box automatically fit the data inside? Please show me an example.2. Can this text box be inside an scrollpane? (so all 200 records could be red)
View 5 RepliesI'm having troubles accessing the data loaded by external class.[code]...
Now, I want to create another external class (called MainMenu) that will be initiated from the Main class.This class should create the menu based on the loaded XML class.
My question is, how can I make use of the loaded XML content via XMLLoader class within the MainMenu class?
i am using loadvars to load url encoded data from a php file.
when i trace the output it shows that the variables have been retrived successfully.
now i need to use the values by assingning then to a variable. i cant seem to get this going
i am using flash 8 with as2.
myVars.onLoad = function (success) {
if (success) {
trace (" variables loaded ");
ad1id.text = myVars.ad1id;
[Code].....
is the above method used for assigning the variables correct.
I'm loading data using multiple LoadVars. How do I evoke a mc to be visible=false; after all data are loaded?
View 4 RepliesI need to clone .png image data loaded from server in AS3, so that I am not required to load same data again and again from server. After a search on cloning image data in AS3 I was able to find following code over internet clone = new Bitmap(Bitmap(this._loader.content).bitmapData.clone()) By using this code I am able to clone bitmap data but the problem which I am facing is that my png background is transparent. If I typecast loaded png data to bitmap my icons background becomes white.
[Code]....