Problem on creating a button with as2

I buy a template with the following code which loads a logo

_root.createEmptyMovieClip("logo",_root.getNextHighestDepth());

 _root.createEmptyMovieClip("menuholder",_root.getNextHighestDepth());
 _root.attachMovie("mbg","menumask",_root.getNextHighestDepth(),{_width:960, _height:Stage.height,_x:(Stage.width/2)-480, _y:_root.menuholder._y, _alpha:0});

logoLoad(XMLoptions_logourl,_root.logo); 


initHeader = function () {
 logoLoad = function (path, targetMovie) {
 targetMovie._alpha = 0;
 var my_mcl:MovieClipLoader = new MovieClipLoader();
 var mclListener:Object = new Object();
 my_mcl.addListener(mclListener);
 mclListener.onLoadInit = function() {
 targetMovie._y = _root.XMLoptions_headerheight-Math.floor((XMLoptions_logoheight/2)+(XMLoptions_menuheight/2))-XMLoptions_logopaddingy;
 Tweener.addTween(targetMovie,{_alpha:100, time:1, transition:"easeOutSine"});
 //
 //LOGO ORIENTATION
 //
 if(XMLoptions_logoorientation=="right"){
 targetMovie._x = Math.floor((Stage.width/2)+480-targetMovie._width-XMLoptions_logopaddingx);
 }else if(XMLoptions_logoorientation=="center"){
 targetMovie._x = (Stage.width/2)-(targetMovie._width/2);
 }else if(XMLoptions_logoorientation=="left"){
 targetMovie._x = Math.floor((Stage.width/2)-480)+XMLoptions_logopaddingx;
 }
 };
 my_mcl.loadClip(path,targetMovie);
 };

I want to add a logo that will be in the right, if the logo is on the left, and I want this logo to have a substitution as a button effect, so I add this code

_root.createEmptyMovieClip("logo2",_root.getNextHighestDepth());
logo2Load(XMLoptions_logo2url,_root.logo2);


logo2Load = function (path, targetMovie) {
 targetMovie._alpha = 0;
 var my_mcl:MovieClipLoader = new MovieClipLoader();
 var mclListener:Object = new Object();
 my_mcl.addListener(mclListener);
 mclListener.onLoadInit = function() {
 targetMovie._y = _root.XMLoptions_headerheight-Math.floor((XMLoptions_logoheight/2)+(XMLoptions_menuheight/2))-XMLoptions_logopaddingy;
 Tweener.addTween(targetMovie,{_alpha:100, time:1, transition:"easeOutSine"});
 //
 //LOGO ORIENTATION
 //
 //test=false;
 if (test==true){
 if(XMLoptions_logoorientation=="right"){
 targetMovie._x = Math.floor((Stage.width/2)-480)+XMLoptions_logopaddingx;
 }else if(XMLoptions_logoorientation=="center"){
 targetMovie._x = (Stage.width/2)-(targetMovie._width/2);
 }else if(XMLoptions_logoorientation=="left"){
 targetMovie._x = Math.floor((Stage.width/2)+480-targetMovie._width-XMLoptions_logopaddingx);
 }}test=true;
 targetMovie.onRollOver = function(){
 logo3Load(XMLoptions_logo2over,_root.logo2);
 };
 
 
 };
 my_mcl.loadClip(path,targetMovie);
 };
 //
 logo3Load = function (path, targetMovie) {
 targetMovie._alpha = 0;
 var my_mcl:MovieClipLoader = new MovieClipLoader();
 var mclListener:Object = new Object();
 my_mcl.addListener(mclListener);
 mclListener.onLoadInit = function() {
 targetMovie._y = _root.XMLoptions_headerheight-Math.floor((XMLoptions_logoheight/2)+(XMLoptions_menuheight/2))-XMLoptions_logopaddingy;
 Tweener.addTween(targetMovie,{_alpha:100, time:1, transition:"easeOutSine"});
 //
 //LOGO ORIENTATION
 //
 
 
 targetMovie.onRelease = function(){
 getURL(XMLoptions_urlredirect, "_self"); 
 
 };
 targetMovie.onRollOut = function(){
 //Tweener.removeTweens(_root.footer.tooltip);
 //removeMovieClip(_root.footer.tooltip);
 test=false;
 logo2Load(XMLoptions_logo2url,_root.logo2);
 };
 
 };
 my_mcl.loadClip(path,targetMovie);
 };

That makes the page sometimes do strange things because im the logo instead of changing the image, what is the proper way to change the XMLoptions_logo2url on XMLoptions_logo2over image on load bearing?

Try:

Button.prototype.swapDepths = MovieClip.prototype.swapDepths;

var tl:MovieClip =;

logo2Btn.swapDepths (1000000);

trace (logo2Btn + "" + this.getNextHighestDepth ());

setTimeout (traceF, 5000);

function traceF() {}

trace (TL.getNextHighestDepth ())

}

Tags: Adobe Animate

Similar Questions

  • How to create a button with rollover that appears in a different place than the button when you move?

    Hello

    How to create a button with rollover that appears in a different place than the button when you move by using only the Muse (reversal may be a different shape and color of the button). I managed to do it using Photoshop and the separate layers and import it, but it is not a good solution. All suggestions will be welcome.

    Thank you

    You can try to use the widget of the Composition of the ToolTip. In this way, the trigger area is isolated and a "State of reversal" can be placed anywhere on the screen (compared to the trigger).

    • Remove the two triggers additional default
    • Set to display the targets on working capital
    • Select hide all initially.
  • Create a button with a goto command?

    Hello

    I was wondering if it is possible to create a button with a goto, similar to the 'back' command - button: goto://FolioNavigation/lastview?

    Tim

    I think he's asking a DPS feature that is similar to the following in a browser. After that you go to a page and then click on the back button in a browser, the next button becomes active. That is not taken in charge in DPS applications. Kafoussias can correct me if I misunderstood the question.

  • Creating visible buttons with graphics

    After you have created the button with graphics.

    Button layer... See the CIRCLE, MORE white poster, down the place of show, STRUCK by the black circle.

    Can you tell me it's OK because after I add layer to ActionScript still getting errors.

    I want to assure you that I have up to this point.

    a big thank you to you guys who helps others

    What you are doing inside the both graphic key have no impact on issues relating to the code.    The CLICKED image specifies only the clickable area for the button, it is not an image that is displayed at any time.  It is usually used if the clickable area must be different from that of the top lowest areas.

    If you get any errors, you must copy and paste errors in your ad and view the code associated with them.

  • create a dynamic button with AS2

    Hi, this is my code, my problem is how to turn this ["mc" + i] to a clickable button, see the code towards the end? It isn't do, indeed, on the screen, he is not yet "button-abled. I did some research, couldn't find anything, please help.

    what the script did to load a series of arrayFlag [i] (ext jpeg files) into "mc" + i, and supposingly when you click these jpeg on screen would be loadMovie to another mc, now they re not to behave like buttons

    for (var i = 0; i < = flagArray.length; i ++) {}

    arrayFlag [i] = "country/thumb /" + flagArray [i];

    arrayBg [i] = "country /" + flagArray [i];

    -flags-

    MyButton = this.createEmptyMovieClip ("mc" + i, i);

    This ["MC" + i] .loadMovie (arrayFlag [i]);

    This ["mc" + i] ._x = 95 + distance;

    This ["mc" + i] ._y = 0;

    //---------Name----------

    var str:String is flagArray [i].split(".jpg").join("");.

    trace (str);

    This.createTextField("hello_txt",0,10,10,100,20) ("my_txt" + i, 100 + i, distance, 12, 100, 100);

    This ["my_txt" + i] .text = str;

    This ["my_txt" + i] .setTextFormat (format2);

    //--------Text-----------

    This.createTextField("hello_txt",0,10,10,100,20) ("my_title" + i, 200 + i, distance, 0, 150, 100);

    This ['my_title' + i] .text = ' name of the country: ";

    This ["my_title" + i] .setTextFormat (format1);

    -loadMovie-

    This ["mc" + i] .onRelease = function () {< <-does not work}

    mc.loadMovie (arrayBg [i]);

    }

    += distance 193;

    trace (flagArray [i]);

    }

    If you try to load a bitmap and create a button from the loaded bitmap, you are wrong when you say there is no way to do it.

    Just wait until loading is completed before you assign mouse managers to the load target movieclip or, even easier, create a child movieclip and use it as target load and apply the mouse Manager to the parent:

    for (var i = 0; i)<= flagarray.length;="" i++)="">

    arrayFlag [i] = "country/thumb / ' + flagArray [i];

    arrayBg [i] = "country / ' + flagArray [i];

    -flags-

    MyButton = this.createEmptyMovieClip ("mc" + i, i);  your code will be easier for you to read if you used mybutton instead ["mc" + i]

    var loadTarget:MovieClip = mybutton.createEmptyMovieClip("loadTarget",0);

    loadTarget.loadMovie (arrayFlag [i]);

    This ["mc" + i] ._x = 95 + distance;

    This ["mc" + i] ._y = 0;

    //---------Name----------

    var str:String is flagArray [i].split(".jpg").join("");.

    trace (STR);

    This.createTextField("hello_txt",0,10,10,100,20) ("my_txt" + i, 100 + i, distance, 12, 100, 100);

    This ["my_txt" + i] .text = str;

    [this "my_txt" + i] .setTextFormat (format2);

    //--------Text-----------

    This.createTextField("hello_txt",0,10,10,100,20) ("my_title" + i, 200 + i, distance, 0, 150, 100);

    This ['my_title' + i] .text = ' name of the country: ";

    [this 'my_title' + i] .setTextFormat (format1);

    -loadMovie-

    This ["mc" + i] .onRelease = function() {}

    mc.loadMovie (arrayBg [i]);  MC must already exist

    };

    += distance 193;

    trace (flagArray [i]);

    }

  • Create a button with a text layer label

    Hi guys.  Looking for advice on how best to implement a button with a text label.  Initially, I created a rectangle object on a lower layer and with the text in the upper layer through the text tool.  When I group the two objects, and create the button, the text is readable in my InDesign (document) computer screen, but the minute I've put it on my iPad button becomes unreadable and pixelated.  I tried different approaches by moving the text outside the Group of button layer does not display the text at all.  Has anyone experience this problem?  If Yes, what is the best practice?  Thanks in advance.

    If the text is contained in the button, it will be rasterized at the correct resolution to be beautiful on your folio of target dimensions. Unfortunately we do not support vector in option for buttons.

    I do not know what your button design, but a common approach is to put the text of the button on the background of your page and put a transparent button on top of it to trigger the action. That way your text will be vector (in the PDF which forms the background of the page) and the button is just a transparent top hotspot.

    Neil

  • Problem when creating a report with a date of schduled

    When I tried to create a report with a schedule (any option except now) I get the error 'Date of the first report occur must be after or equal to the current date", unless I have use a date of 01-10-2012 or later in the first report occurs on the field.  Current date is 2012-08-23.

    Let me know if you can recreate it and if or when there is a fix.

    Hi Tim,.

    We have fixed the problem now. Could you please check that you are able to schedule a report now with start date of today?

    Thank you

    The OnPlus team

  • Can I create a button with hyperlink to my website?

    I use the first element 9 for video editing. I wonder if it is possible to create a button at the end of the film so people can click on it to my Web site.

    I have photoshop and dreamweaver, but I don't have flash or fireworks.

    Anyone know? Thank you!

    N ° not with Premiere Elements. I'm sorry.

  • How can I create a button with alpha background and text? When the alpha element group influence all elements, but the text remains 100%

    When the alpha element group influence all elements, but the text remains 100%
    I try with the Group of elements and no group, but include elements in the 'State' of the widget library button. Nothing!

    Explain dough my problem and please excuse my English...
    I need to have a transparent background with text (name and job) at the start. When I rollon with the cursor of the mouse on the button background should take a color with 60% alpha, required text full color stay, but if I group or insert State of the item on Rollo button mouse everything take alpha 60%

    I need to regroup or insert in elements went State button because if they are ungruoped to mouse Rollo on bottom its all is ok, but when the mouse passes over the background of text out you of you initial state.

    Can someone help me please?

    I think I know your problem - are you using the opacity of the 'effects' rather than opacity to "fill" - one of the effects will affect the entire element rather than just the rectangle.

    Use this opacity

    not this one

  • I created a button with an animation in a loop...

    ... that I want to play only when mousedover and stop (hide) on mouseout/mouseouthandler().

    Right now it's stop and start once I mouseover the time affects the first. But when it loads it is not hidden. Here is the code I have so far:

    MouseOver

    var mySymbolObject = sym.getSymbol ("ButtonSlider");

    SYM.$("ButtonSlider"). CSS({Opacity:1});)

    Mouseout/mouseouthandler()

    var mySymbolObject = sym.getSymbol ("ButtonSlider");

    SYM.$("ButtonSlider"). CSS({Opacity:0});)

    Click

    SYM. Play (0000);

    I tried a trigger to hide on the time line with the same code on the buttons, but the ButtonSlider stays hidden.

    Thanks for you help in advance.

    You need to target the button element in the button symbol. So here's the updated code:

    {sym.$("ButtonSlider"). MouseEnter (Function ()})

    sym.getSymbol("ButtonSlider").$('Button').show ();

    });

    {sym.$("ButtonSlider"). MouseLeave (Function ()})

    sym.getSymbol("ButtonSlider").$('Button').hide ();

    });

    {sym.$("ButtonSlider"). Click (Function ()})

    SYM. Play (0);

    });

  • Creating a button of type rolling with an image effect? (Captivate 7)

    I want to do is create something so that when you place the cursor or roll on a specific area, it displays an image (it will appear under where is your mouse pointer). When you move your mouse from a distance, the image disappears. And if you click on the image when it appears (as it will be under your mouse), it leads to another slide or runs a tip action.

    If I use a slidelet, I move the slidelet piece behind the scenes because I don't want to think I use just to keep the slidelet area and put there where I want. Then, I put the image I want non-visible output and set it so that roll on the slidelet area 'shows' this image. Of course, the problem with this is that, when you mouse off the coast, the image is still there. Without creating a button with different States, does something like this happen?

    To clarify a bit more, I have a picture of a menu created. The menu is a list of text items, you can click, listed vertically, as:

    -Learn how to open a session

    -Learn how to check your notes

    -Learn how to send a message

    and so on.

    I have an image of each line of text replaced by a different color, with an arrow next to it. So, I want to turn so when you hover over "Learn how to connect", it will turn blue with an arrow next to it. This effect disappears when you move your mouse off the power. And when you click it, it takes you to a specific slide.

    What is the best way to achieve this?

    Why not just use a rollover Image object (insert > Standard objects > rollover Image.)  Then place a click box on the layer directly below the object of turning so that it reacts to a click.

  • Problem of FW CS4 export buttons with rollover to dreamweaver

    Fireworks newbie here-

    I created a button with several States in fireworks cs4 and have problems exporting to Dreamweaver.

    (1) if I have the file-> Preview in the browser by the key works fine.

    (2) if I export using the "HTML and Images" export option, my button works correctly.

    (3) but if I export using the "CSS and Images" export option, my button does not work. When I take a glance at what has exported to Dreamweaver, I notice that only the gif for the up State was exported and I also notice that no javascript code has been exported.

    I'm stumped, any suggestions?

    Yes, your observation is correct. Export CSS + Images does not include Javascript, only the texts, the slices of rectangles and images. JavaScript is only included export "HTML + Images", which is a traditional prototype export. It creates fixed, based on tables layouts is not really suitable for production sites.

    As far as I know, the two workflows is not interchangeable and is intended for different purposes. If you go for export of CSS and other changes in DW, I recommend to use CSS for your States of button sprites. Also, if you go this route, it is a good idea to familiarize yourself with the features and limitations of export CSS + Images:

    http://www.Adobe.com/devnet/Fireworks/articles/export_css_images.html

    We have members with more knowledge in this area - I know not that they will help out you further. Good luck!

    SiamJai

    --------------------------------------------

    Fireworks innovative tutorials

  • Button with random time and pictures at random

    With as3, I would create a button with photos randomly changing random time.

    Any advice?

    Thank you.

    Try to use: this.addChild (this ["image" + String (i)]);

  • How to create a StackedAreaChart with a desabscisses (xAxis) axis?

    Hi all

    While it is not a problem to create an AreaChart with an axis desabscisses I wonder why I can't create a StackedAreaChart with a desabscisses axis.

    When executing this Code I am getting and java.lang.ClassCastException (java.lang.Double cannot be cast to java.lang.String) in the last line "primaryStage.show ()";

    I would appreciate your suggestions.
    public class JavaFXCharts extends Application {
    
        final ObservableList<String> categories2 = FXCollections.observableArrayList("1", "3","6", "9","12","15","18","21","24","27","30","31");
        final CategoryAxis xAxis = new CategoryAxis(categories2);
        final NumberAxis yAxis = new NumberAxis();
        final StackedAreaChart<String, Number> sac =
                new StackedAreaChart<>(xAxis, yAxis);    
        
        
        @Override
        public void start(Stage primaryStage) {
    
            primaryStage.setTitle("Area Chart Sample");
            sac.setTitle("Temperature Monitoring (in Degrees C)");
            XYChart.Series<String, Number> seriesApril =
                    new XYChart.Series<>();
            seriesApril.setName("April");
            seriesApril.getData().add(new XYChart.Data("1", 4));
            seriesApril.getData().add(new XYChart.Data("3", 10));
            seriesApril.getData().add(new XYChart.Data("6", 15));
            seriesApril.getData().add(new XYChart.Data("9", 8));
            seriesApril.getData().add(new XYChart.Data("12", 5));
            seriesApril.getData().add(new XYChart.Data("15", 18));
            seriesApril.getData().add(new XYChart.Data("18", 15));
            seriesApril.getData().add(new XYChart.Data("21", 13));
            seriesApril.getData().add(new XYChart.Data("24", 19));
            seriesApril.getData().add(new XYChart.Data("27", 21));
            seriesApril.getData().add(new XYChart.Data("30", 21));
            XYChart.Series<String, Number> seriesMay =
                    new XYChart.Series<>();
            seriesMay.setName("May");
            seriesMay.getData().add(new XYChart.Data("1", 20));
            seriesMay.getData().add(new XYChart.Data("3", 15));
            seriesMay.getData().add(new XYChart.Data("6", 13));
            seriesMay.getData().add(new XYChart.Data("9", 12));
            seriesMay.getData().add(new XYChart.Data("12", 14));
            seriesMay.getData().add(new XYChart.Data("15", 18));
            seriesMay.getData().add(new XYChart.Data("18", 25));
            seriesMay.getData().add(new XYChart.Data("21", 25));
            seriesMay.getData().add(new XYChart.Data("24", 23));
            seriesMay.getData().add(new XYChart.Data("27", 26));
            seriesMay.getData().add(new XYChart.Data("31", 26));
            Scene scene = new Scene(sac, 800, 600);
            sac.getData().addAll(seriesApril, seriesMay);
            primaryStage.setScene(scene);
            primaryStage.show();
        }
    }
    Greetings
    Thomas

    For JavaFX 2.2.3 there is a bug creating a StackedAreaChart with a desabscisses (xAxis) axis

    http://JavaFX-JIRA.Kenai.com/browse/RT-23812 "StackedAreaChart ClassCastException on axis desabscisses"

    The bug is fixed in the jdk8 branch and planned to backport and JavaFX 2.2.6 release (next year I think).

    Link to the source diff patch:
    http://Hg.OpenJDK.Java.NET/openjfx/8/controls/RT/Rev/d811a42d75ba

  • How to create a button to run an insert and remove the statement

    Hello. I have a tabular presentation page that allows me to view the contents of a table and update the data in two columns of the table. I want to create a button on the same page and when the button is clicked the following actions occur

    1. Insert a new table all the values in the table as a table where the two editable fields are not null.
    2. remove from the table in a table all records where the editable fields are not null
    3. back to the current page... This will show me all the lines where the editable fields are always set to null.

    I tried to do this by creating a button manually and by using a sql expression to first try the Insert... It did not work. So I'm looking for a pointer to what would be the best method.
    Concerning
    Craig

    Hello

    create the button with "Defined by the dynamic action" action.

    The creation of a dynamic action on the button who has run the PL/SQL code

    Kind regards
    Richard

    -----
    blog: http://blog.warp11.nl
    Twitter: @rhjmartens
    If you answer this question, please mark the thread as closed and give points where won...

Maybe you are looking for

  • "Stop: c0000135" and "winsrv was not found" error

    Hello: I'm working on my aunt's computer and she recently started having an error message when it tries to start his computer: "Stop: c0000135" and "winsrv was not found" error.  I can't start in safe mode because it just goes back to the blue screen

  • I can't connect to my wifi using my hp 14-d008au...

    After I reformT my 14-d008au hp windows 7 lost my wireless connection... so I go into my device manager > other devices > unknown device > properties > details > hardware ID: AMDUSB30\ROOT_HUB30 & VID_1022 & PID_7814 & REV_0001 & SID_2191103C AMDUSB3

  • examples of photos

    I used one of the images sample provided with vista. leaves of autumn. I wonder now for £574 for the use of this image. If it is provided with this pc why am I continued Bill patterson

  • We can recover model fuse CC Library Adobe?

    I have a model fuse stored in one of my old accounts Adobe CC library and I would like to recover in fuse... is it possible?is there a workaround solutions that might send it Mixamo first?is there a file listing the parts | parameters of the model?to

  • How to replace the complex paths with an image?

    I try to add the image of the "CINCO CrossFit" logo on the surfboard of the user divided horizontally.What is the best way to do it? BTW - I have the complete eps file, but I didn't block the forum with such a huge file.Thanks in advance for your hel