Jump to content

Moveable Map?


Anakha92

Recommended Posts

Hi everyoneI have a little problem... For a while I've been trying to make a RuneScape world map for my RuneScape fan site just like the one on the official RuneScape webpage and I have absolutely no idea on how to allow users to hold down their mouse button and drag around the map to navigate it... I have the map as a Jpg and I wish to know how do this. Also, could you let me know how to creat a drop down in the same window and each option you choose will go to a different part in the map? Thanks...

Link to comment
Share on other sites

ExampleThe following example creates a movie clip, pic_mc, at runtime that users can drag to any location by attaching the startDrag() and stopDrag() actions to the movie clip. An image is loaded into pic_mc using the MovieClipLoader class.var pic_mcl:MovieClipLoader = new MovieClipLoader();pic_mcl.loadClip("http://www.helpexamples.com/flash/images/image1.jpg", this.createEmptyMovieClip("pic_mc", this.getNextHighestDepth()));var listenerObject:Object = new Object();listenerObject.onLoadInit = function(target_mc) { target_mc.onPress = function() { startDrag(this); }; target_mc.onRelease = function() { stopDrag(); };};pic_mcl.addListener(listenerObject);Above is from Flash helpyou can change your image to a symbol (graphic type, for e.g) and name it "image"after that, click on that image and press F9then type these action scripton (press) { startDrag();}on (release) { stopDrag();}About the second, you should know the usage of combo box in Flash components:)

Link to comment
Share on other sites

About the second, you should know the usage of combo box in Flash componentssmile.gif
What do you mean? :)Edit: Oh and what do I do with that? Do I just place it in a regular html document, changing file names when necessary?
Link to comment
Share on other sites

Here is of Flash Help, I don't sure the way of creating HTML combo box for changing betwwen map.swf files Creating an application with the ComboBox componentThe following procedure explains how to add a ComboBox component to an application while authoring. In this example, the combo box presents a list of cities to select from in its pop-up list.To create an application with the ComboBox component:Drag a ComboBox component from the Components panel to the Stage. Select the Transform tool and resize the component on the Stage. The combo box can only be resized on the Stage during authoring. Typically, you would only change the width of a combo box to fit its entries. Select the combo box and, in the Property inspector, enter the instance name comboBox. In the Component inspector or Property inspector, do the following: Enter Minneapolis, Portland, and Keene for the label parameter. Double-click the label parameter field to open the Values dialog box. Then click the plus sign to add items. Enter MN.swf, OR.swf, and NH.swf for the data parameter. These are imaginary SWF files that, for example, you could load when a user selects a city from the combo box.Select Frame 1 in the Timeline, open the Actions panel, and enter the following code: function change(evt){ trace(evt.target.selectedItem.label);}comboBox.addEventListener("change", this);The last line of code adds a change event handler to the ComboBox instance. For more information, see ComboBox.change.To create a ComboBox component using ActionScript:Drag the ComboBox component from the Components panel to the current document's library. This adds the component to the library, but doesn't make it visible in the application.Select the first frame in the main Timeline, open the Actions panel, and enter the following code: this.createClassObject(mx.controls.ComboBox, "my_cb", 10);my_cb.addItem({data:1, label:"One"});my_cb.addItem({data:2, label:"Two"});This script uses the method UIObject.createClassObject() to create the ComboBox instance, and then uses ComboBox.addItem() to add list items to the ComboBox.Now add an event listener and event handler function to respond when a ComboBox item is selected: // Create listener object.var cbListener:Object = new Object();// Create event handler function.cbListener.change = function (evt_obj:Object) { trace("Currently selected item is: " + evt_obj.target.selectedItem.label);}// Add event listener.my_cb.addEventListener("change", cbListener);Select Control >Test Movie, and click an item in the combo box to see a message in the Output panel.

Link to comment
Share on other sites

^ No...all you need is Flash...You do have flash right!!...:)If you dont have it (which would be the OBVIOUS major problem at the moment) Go to:...oh...hang on due to the forthcoming release of Flash CS3 you cant download a trial! :)Basically what smiles was explaining (very well!) was that you would need to use Actionscript to enable to do what you want to do!Ed

Link to comment
Share on other sites

^ No...all you need is Flash...You do have flash right!!...:)If you dont have it (which would be the OBVIOUS major problem at the moment) Go to:...oh...hang on due to the forthcoming release of Flash CS3 you cant download a trial! :)Basically what smiles was explaining (very well!) was that you would need to use Actionscript to enable to do what you want to do!Ed
Yes, I have flash, and what I mean is, how do I use "Actionscript" to do this? To be honest, I don't even know what that is...
Link to comment
Share on other sites

Actionscript is the programming language which flash uses to do basic and advance processes.I suggests you google actionscript.Go to actionscript.org to learn more :)then come back and learn!!Ed x

Link to comment
Share on other sites

  • 1 month later...

Okay new problem... :) When converting my *.GIF image to a *.SWF using many different programs and ways, they don't convert the who image. I'll post the start image (The *.GIF) and the product I get back (*.SWF) in this post... if someone can tell me how to do that since I see no attachment or image thingymibob here ;D

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...