|
|||
|
am I able to imbed this menu inside an individual flash scene? I don't seem to be able to get the movie clip that is included to compile... ie the existing shockwave file shown in the deploy folder. How do I compolie the flash file shown in section 1? Thanks
Last edited by mtracy; 11-19-2009 at 11:32 PM. |
|
|||
|
Hi, it complies just fine, make sure you copied the flashtory and caurina folders (this folders contain .as files) in same folder with your .fla file and inside the .fla file make sure you have in your library (Ctrl +L) the contents of the source .fla fibrary, a folder called Fonts and also the movieclip called HorizontalScrollingMenu, now just drag and drop the HorizontalScrollingMenu on your stage (which is just an empty movieclip that has linkage to "flashtory.Main" the Main.as file in the folder flastory).
Cheers, Ionut. |
|
|||
|
is it possible to insert six or seven different instances of this nav bar into the same flash document? Basically I'm trying to create a two level nav bar but am having difficulty instantiating multiple instances of the horizontal nav bar... ie using this clip as a sub menu.... I really like the look of the menu for my purposes but need it to act in multiple instances as a sub menu. Thanks
Last edited by mtracy; 12-02-2009 at 11:47 PM. |
|
|||
|
Hi, you can insert any number of instances you want by dragging as many HorizantalScrollingMenu movieclips from the library(Ctrl+L) to the stage, and making sure they have a specified height (not 0) so that they won't resize to the stage height. But this instances will all use the buttons defined in data.xml, to have different menus with different xmls you need to load the menu as a swf in your project (so you can have different swf in different folders using they own data.xml). Or you can go into 1 - Source/flashtory, and copy Main.as then make something like Main2.as, Main3.as etc, remembering to open the new .as files and replace "public class Main extends MovieClip" with "public class Main2 extends MovieClip" on line 15 and "public function Main()" with "public function Main2()" on line 54, them modify loader.load(new URLRequest("data.xml")); to loader.load(new URLRequest("data2.xml")); for example, and so on for all the files. After that duplicate the HorizantalScrollingMenu movie clip from the library and link the new mc to your new Main class, "flashtory.Main2" for example, add the new clip to the stage and you now have a new menu wich uses a diffrent xml.
Cheers, Ionut. |
|
|||
|
Hi,
I have a problem, trying to modify code to load external swf directly. For this reason code changes in URLNav.as Code:
/**
* @author Ionut
* @www: http://www.flashtory.com
*/
package flashtory.HorizantalScrollingMenu{
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.display.Stage;
import flash.display.MovieClip;
import flash.events.*;
import flash.net.URLRequest;
// this class is ussed to call links
public class URLNav extends MovieClip {
// the url and the target
private var url:String;
private var target:String;
// this set the private vars from the params
public function URLNav(u:String, t:String) {
url=u;
rel="nofollow" target=t;
}
//this funtion calls a link
public function callLink():void {
var loader:Loader = new Loader();
configureListeners(loader.contentLoaderInfo);
loader.addEventListener(MouseEvent.CLICK, clickHandler);
var request:URLRequest=new URLRequest(url);
loader.load(request);
addChild(loader);
loader.x=100;
loader.y=100;
}
private function configureListeners(dispatcher:IEventDispatcher):void {
dispatcher.addEventListener(Event.COMPLETE, completeHandler);
dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
dispatcher.addEventListener(Event.INIT, initHandler);
dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
dispatcher.addEventListener(Event.OPEN, openHandler);
dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
dispatcher.addEventListener(Event.UNLOAD, unLoadHandler);
}
private function completeHandler(event:Event):void {
trace("completeHandler: " + event);
}
private function httpStatusHandler(event:HTTPStatusEvent):void {
trace("httpStatusHandler: " + event);
}
private function initHandler(event:Event):void {
trace("initHandler: " + event);
}
private function ioErrorHandler(event:IOErrorEvent):void {
trace("ioErrorHandler: " + event);
}
private function openHandler(event:Event):void {
trace("openHandler: " + event);
}
private function progressHandler(event:ProgressEvent):void {
trace("progressHandler: bytesLoaded=" + event.bytesLoaded + " bytesTotal=" + event.bytesTotal);
}
private function unLoadHandler(event:Event):void {
trace("unLoadHandler: " + event);
}
private function clickHandler(event:MouseEvent):void {
trace("clickHandler: " + event);
var loader:Loader=Loader(event.target);
loader.unload();
}
}
}
Of course don't work, can you help me? THX Last edited by this; 12-10-2009 at 11:26 AM. |
|
|||
|
I do not understand, why if I add a clip to the stage in code changes in URLNav.as in a standard way like
Code:
var cargo1:cargox = new cargox(); addChild(cargo1); If I use this code in other file.as this come to the stage but don't communicate with URLNav.as code Please help me. THX |
|
|||
|
Hi this, sorry for the late reply, you modified the URLNav class to extend movieclip class wich means you have to do an addchild for the URLNAv to, you added what ever you are loading on the loader but the urlnav which contains the added loader probably isn't added to stage.
Hope this helps, Ionut. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|