Swap Background image using ActionScript

I need to know how to change (swap) background images.
Explanation:
The main file (level 0) is named "Master".
In the Master timeline, the lowest layer is named "bg" (for
backgrround).
On the bg layer is an image the size of the stage, and this
image forms the background against which other movie clips (.swf)
are shown.
Purpose:
In response to a user (ie: the user clicks a button), I want
to change the background image.
Problem:
I have searched through Flash 8 Help system, and cannot find
how to delete the 1st image from the "bg" layer, and add a
different image.
Hoping someone knows the answer,
Thanks,
John

convert your image to a movieclip. you can then use
movieclipInstanceName.removeMovieClip() to remove it. or, if you
might want to use it latter in your swf, change its _visible
property.

Similar Messages

  • I need help Centering a div box to a background image using dreamweaver cs5.5.

    I need help Centering a div box to a background image using dreamweaver cs5.5. Everything shift left when viewing on different size monitors?  See what I mean at
    www.woodlandhospice.com

    Have you looked at your page with images disabled?
    I urge you to re-think this approach to web design because images of text are not indexed by search engines, screen readers or translators.  Given the demographic group your site is targeting, you really need to ensure maximum web accessibility for all users.
    Navigation, headings and descriptions all need to be in real text -- not images of text.
    Ken is right.  Absolute positioning is pure poison for such a simple layout.  My advice is to start over with one of the pre-built Starter Pages in DW.  Go to File > New > Blank page > HTML.  Select a layout from the 3rd column and hit CREATE button.
    Nancy O.

  • I would like to know how to stretch a background image using HTML

    Hello Seniors of Sun,
    I gota small doubt in HTML, can any one please help me in solving it,
    I would like to know how to stretch a background image using HTML? I have tried and tried to figure this out and cannot..
    so any one kindly help me in this...
    waiting for reply...

    Please note that this is not an HTML forum.
    You can use an image tag on a DIV positioned behind the rest of the page, so that could actually work. And if you want to use body:background, then look up an HTML/CSS reference and see if there are any other body attributes or CSS stuff that applies to the background image.

  • Swap background image?

    Hi,
    I am looking for a posibility to dynamicaly change the background image of a vi.
    See attached example: The switch should change the circle-image into a box-image. the two images are overlaid and I thought I could make one image visible and the other invisible, but the images have no terminal in the block diagramm...
    Any idea?
    Greetings Johannes
    Using LabVIEW 7.1 and 2009 recently
    Solved!
    Go to Solution.
    Attachments:
    Swap image.vi ‏17 KB

    I can not open LV 9.0-VIs
    Could you please either save it as 7.1 or upload a screenshot?
    Thanks.
    BTW here is a screenshot of my problem:
    Greetings Johannes
    Using LabVIEW 7.1 and 2009 recently
    Attachments:
    Problem.PNG ‏27 KB

  • Setting a background image using CSS Designer

    I am trying to set a background image for a page header using the CSS Designer. When I click the browse button the Select Image Source dialog box launches but any time I click on something the dialog box closes and no changes are made. Does anyone know what is causing this?

    Which DW are you using and which platform/OS, please? I am unable to reproduce this with CC2014 on OS10.9.4

  • Dynamically swap background image with mouseover

    Hello, I need some help with this menu file. My inspiration was a post of Resdesign.
    I want to make a rollover that swap the background image for each button.
    I tried a lot of methods but I cant find the solution (please check line 111).
    Here is my file:
    WeTransfer
    Thanks a lot!
    alex from argentina

    Thanks Preran for your answer but I can´t find the way to implement the solution in that post.
    I tried this:
    // mouseover swap background
    sym.$('#newBtn'+i).mouseover(function(){
      sym.$("#newBtn"+i).css({'background-image':'url("images/fover.jpg")'});
      //sym.getSymbol("#newBtn"+i).$('background').attr('src',info[i].backo);
    Thanks!

  • ADF Mobile : Setting background image using inline style not working.

    The snippet is part of my amx page.
    But the issue is that the background image is not coming up in the deployed iphone application.
    The html source of app page shows that a background image is associated with this component but the location is file:///Users/oracle/Library/Application%20Support/iPhone%20Simulator/5.0/Applications/com.oracle.smartphone/smartphone.app/backgroundrepear.png instead of some Xcode_Project>Far location which I was expecting.
    The image is actually present in public_html/icons
    And I set the inline style using the property inspector of listItem.
    <amx:listItem showLinkIcon="true" id="li1" action="goToWorkerDetail"
    inlineStyle='background-image:url("/icons/backgroundrepear.png"); background-repeat:repeat-x;'>
    <amx:tableLayout width="100%" id="tl1">
    <amx:rowLayout id="rl2">

    955920 wrote:
    The snippet is part of my amx page.
    But the issue is that the background image is not coming up in the deployed iphone application.
    The html source of app page shows that a background image is associated with this component but the location is file:///Users/oracle/Library/Application%20Support/iPhone%20Simulator/5.0/Applications/com.oracle.smartphone/smartphone.app/backgroundrepear.png instead of some Xcode_Project>Far location which I was expecting.
    The image is actually present in public_html/icons
    And I set the inline style using the property inspector of listItem.
    <amx:listItem showLinkIcon="true" id="li1" action="goToWorkerDetail"
    inlineStyle='background-image:url("/icons/backgroundrepear.png"); background-repeat:repeat-x;'>
    <amx:tableLayout width="100%" id="tl1">
    <amx:rowLayout id="rl2">hi,
    i managed to get the background-image working. I dont use inlineStyle , instead i use "Skinning"
    Since im want all my pages have the same background image, i overwrite the panel page css
    .amx-panelPage {
    background-image: url("../pic1.jpg");
    the css file is located under "ApplicationController/public_html/resources/css/myiPhone.css"
    the image file is located under "ApplicationController/public_html/resources/pic1.jpg"

  • Scaling and Image using ActionScript 3.0

    Hello, I need some help from the experts out here. I have created a thumbnail gallery and am using an external ActionScript 3.0 document to try and scale each of the thumbnails as I rollover them. There are 23 thumbnails. Rather than define all the variables and functions for all 23, is there a way I can create some sort of array so that each thumbnail will be scaled by the instance name defined in the variable array and same for the functions. The code below works for one image I have created. As you can see the idea is to hover over the image, it scales up, then you click on it and are taken to some other content stored locally or externally on a web server. Thanks in advance.
    package {
    import flash.display.Sprite;
    import flash.display.MovieClip;
    import flash.display.StageScaleMode;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import com.greensock.*;
    import com.greensock.easing.*;
    import flash.net.URLRequest;
    import flash.net.URLVariables;
    import flash.net.navigateToURL;
    public class imageContainer extends MovieClip {
    private var tween1:TweenLite;
    private var tween2:TweenLite;
    private var aigContent:URLRequest = new URLRequest("http://robertreich.blogspot.com/2009/03/obamas-first-priority.html");
    public function imageContainer() {
    aig.addEventListener(MouseEvent.ROLL_OVER, scaleIt1);
    aig.addEventListener(MouseEvent.ROLL_OUT, scaleIt2);
    aig.addEventListener(MouseEvent.CLICK, clickIt);
    private function scaleIt1(event:MouseEvent):void{
    tween1 = new TweenLite(aig, 1, {scaleX:1.5, scaleY:1.5});
    private function scaleIt2(event:MouseEvent):void{
    tween2 = new TweenLite(aig, 1, {scaleX:1, scaleY:1});
    private function clickIt(event:MouseEvent):void{
    navigateToURL(aigContent);

    danialj wrote:
    Hello, I need some help from the experts out here. I have created a thumbnail gallery and am using an external ActionScript 3.0 document to try and scale each of the thumbnails as I rollover them. There are 23 thumbnails. Rather than define all the variables and functions for all 23, is there a way I can create some sort of array so that each thumbnail will be scaled by the instance name defined in the variable array and same for the functions. The code below works for one image I have created. As you can see the idea is to hover over the image, it scales up, then you click on it and are taken to some other content stored locally or externally on a web server. Thanks in advance.
    package {
    import flash.display.Sprite;
    import flash.display.MovieClip;
    import flash.display.StageScaleMode;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import com.greensock.*;
    import com.greensock.easing.*;
    import flash.net.URLRequest;
    import flash.net.URLVariables;
    import flash.net.navigateToURL;
    public class imageContainer extends MovieClip {
    private var tween1:TweenLite;
    private var tween2:TweenLite;
    private var aigContent:URLRequest = new URLRequest("http://robertreich.blogspot.com/2009/03/obamas-first-priority.html");
    public function imageContainer() {
    aig.contentVar = "aigurl"; // use the correct url
    aig.addEventListener(MouseEvent.ROLL_OVER, scaleIt1);
    aig.addEventListener(MouseEvent.ROLL_OUT, scaleIt2);
    aig.addEventListener(MouseEvent.CLICK, clickIt);
    private function scaleIt1(event:MouseEvent):void{
    tween1 = new TweenLite(event.currentTarget, 1, {scaleX:1.5, scaleY:1.5});
    private function scaleIt2(event:MouseEvent):void{
    tween2 = new TweenLite(event.currentTarget, 1, {scaleX:1, scaleY:1});
    private function clickIt(event:MouseEvent):void{
    navigateToURL(event.currentTarget.contentVar);

  • Adding background image using Loader ()

    Hi all,
    Am working on a simulation and am running into some trouble.
    I am attaching what I have so far. (I'm just in beginning stages so
    it's nothing fancy)
    What I still need to do is place the main image into the code
    using this code:
    var somePictLdr:Loader = new Loader();
    var request:URLRequest = new URLRequest("octopus.jpg");
    <--name of my image on my desktop
    somePictLdr.load(request);
    addChild(somePictLdr);
    I don't know where to put the code in what I already have.
    Can anyone help?
    Also, I want to add some sort of stop button so when the user
    presses 'b' for blue, the blue bubbles come up but when the user
    presses 'o' for orange, I want the blue bubbles to stop and the
    orange ones to come up.
    Can anyone help me? I have messed up the code so many times
    that I'm scared to go back into it and mess up what is actually
    semi-working. I just need to know exactly where the code goes and
    what it should say because I can't even get that part right. *ugh*
    Thank you.
    Jill

    Hi jillybean,
    On where to place the code in question, you want to declare
    the variable above the bath2 constructor function, by the bubble
    array declaration, for example. With slight changes, also, like
    this:
    var somePictLdr:Loader;
    var request:URLRequest;
    The code for loading the pic should go in the bath2
    constructor function, as follows:
    public function bath2() {
    somePictLdr = new Loader();
    request = new URLRequest("octopus.jpg");
    somePictLdr.load(request);
    addChild(somePictLdr);
    As for your frustration, that is typical of learning a new
    language - more examples, and more success will take care of
    that.

  • Changing a background image according to the time of day/night...

    Hello all:
    I have a client who wants me to put in 2 different background image for an upcoming project,  (one for morning, one for night) and I'm wondering if anyone can tell me how to swap background images depending on what time of the day it is. The other problem is that it has to be through the Flash Designers mode and not the back-end. (if that's even possible)
    The reason being is that I have NO experience with ActionScript 3.0, (I'm only have experience with Dreamweaver, HTML, CSS etc.) so I am a complete and utter newbie in the world of Flash and ActionScript.
    If anyone could help me with this problem, it would be greatly appreciated.
    Thanks.
    Justin.

    I am not sure what you are trying to differentiate between when you say "Flash Designers mode and not the back-end", or what background image you are talking about... but in any case, Flash has the Date class with a getHours() methiod (like javascript) that you can use to tell what hour of the day it is (0 thru 23) which is probably all you'd need to determine when to show which picture.  If the images are in a Flash file, then you can just create a movieclip that has the images in different frames and use the getHours method to decide which frame of that movieclip to be in.

  • The firefox theme(Lava V1-purple) I installed does not show permanently its background image because it quickly disappears when I click a new tab.. how can i fix this???

    When i click a new tab button the background image appears but quickly disappears... I know that this shouldn't happen but it always happen no matter what i try... Can anyone help me??? Please??? I want my background, that is provided by the theme, to stay pemanently when i click the new tab button because the white background for a new tab is totally not my style..

    If you go to [www.zigboom.com ZigBoom] there is a customization tab that will explain how to set your about:blank (New Tab) background image using the Firefox Add-On Stylish. Hope this helps.

  • ISE 1.3 portal customization - background image

    With all the simplicity to adjust the look and feel of portals in the new ISE 1.3 comes (albeit small for some) a price: I no longer see a way to configure a custom adjustments like a background image, not simply a top banner. This was doable in 1.2 via Cisco ISE Portal Builder or custom editing of html files and custom image uploading. Migrated portal still works fine. But since is not editable it's almost unusable.  Is there still a way to do full customization of the portals?

    Here are some steps on how to reference a background image using CSS and ISE 1.3
    If needing help on doing other modification to the portal outside of the basics (like moving elements or resizing) after making the change then please work with web developer experienced in javascript and CSS.
    Export default CSS from ISE:
    Click Guest Access > Configure
    Choose any Portal and click “Edit”.
    Click Portal Page Customization > Advanced Customization
    Choose “Default Blue theme” and click “Export”.
    Open file with editor (for example:Coda,Notepad etc.).
    Edit file:
    Copy and paste
    (Don’t forget to put your picture instead of http://www.your-picture.jpg):
    Add this code AFTER the Defaults theme code
    body .cisco-ise-content {
        background-color: white ;  
    body{ 
    background-image: url("http://www.your-picture.jpg")!important;
        background-size: cover;}
    .ui-dialog-contain > .ui-content {
        background: none repeat scroll 0 0 white;
    body .ui-dialog .ui-dialog-contain .ui-header {
        background: none repeat scroll 0 0 #0a569c;
    .progressWizard .ui-bar-a.step-inner {
    background: linear-gradient(#4da2f1, #4ea5f6) repeat scroll 0 0 #4ea4f4;
    Replace from the code
    .ui-body-a,
    .ui-overlay-a {
        border: 1px solid #d3d3d3 /*{a-body-border}*/;
        color: #666 /*{a-body-color}*/;
        text-shadow: 0 /*{a-body-shadow-x}*/ 0 /*{a-body-shadow-y}*/ 0 /*{a-body-shadow-radius}*/ #ffffff /*{a-body-shadow-color}*/;
        background: #ffffff /*{a-body-background-color}*/;
        background-image: -webkit-gradient(linear, left top, left bottom, from( #ffffff /*{a-body-background-start}*/), to( #ffffff /*{a-body-background-end}*/)); /* Saf4+, Chrome */
        background-image: -webkit-linear-gradient( #ffffff /*{a-body-background-start}*/, #ffffff /*{a-body-background-end}*/); /* Chrome 10+, Saf5.1+ */
        background-image:    -moz-linear-gradient( #ffffff /*{a-body-background-start}*/, #ffffff /*{a-body-background-end}*/); /* FF3.6 */
        background-image:     -ms-linear-gradient( #ffffff /*{a-body-background-start}*/, #ffffff /*{a-body-background-end}*/); /* IE10 */
        background-image:      -o-linear-gradient( #ffffff /*{a-body-background-start}*/, #ffffff /*{a-body-background-end}*/); /* Opera 11.10+ */
        background-image:         linear-gradient( #ffffff /*{a-body-background-start}*/, #ffffff /*{a-body-background-end}*/);
    With:
    .ui-body-a,
    .ui-overlay-a {
        border: 1px solid #d3d3d3 /*{a-body-border}*/;
        color: #666 /*{a-body-color}*/;
    Replace from the code
    .ui-bar-a {
        border: 1px solid #d3d3d3 /*{a-bar-border}*/;
        background: #4ea4f4 /*{a-bar-background-color}*/;
        color: #ffffff /*{a-bar-color}*/;
        font-weight: bold;
        text-shadow: 0 /*{a-bar-shadow-x}*/ 0 /*{a-bar-shadow-y}*/ 0 /*{a-bar-shadow-radius}*/ #0a569c /*{a-bar-shadow-color}*/;
        background-image: -webkit-gradient(linear, left top, left bottom, from( #4da2f1 /*{a-bar-background-start}*/), to( #4ea5f6 /*{a-bar-background-end}*/)); /* Saf4+, Chrome */
        background-image: -webkit-linear-gradient( #4da2f1 /*{a-bar-background-start}*/, #4ea5f6 /*{a-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */
        background-image:    -moz-linear-gradient( #4da2f1 /*{a-bar-background-start}*/, #4ea5f6 /*{a-bar-background-end}*/); /* FF3.6 */
        background-image:     -ms-linear-gradient( #4da2f1 /*{a-bar-background-start}*/, #4ea5f6 /*{a-bar-background-end}*/); /* IE10 */
        background-image:      -o-linear-gradient( #4da2f1 /*{a-bar-background-start}*/, #4ea5f6 /*{a-bar-background-end}*/); /* Opera 11.10+ */
        background-image:         linear-gradient( #4da2f1 /*{a-bar-background-start}*/, #4ea5f6 /*{a-bar-background-end}*/);
    with 
    .ui-bar-a {
        border: 1px solid #d3d3d3 /*{a-bar-border}*/;
        color: #ffffff /*{a-bar-color}*/;
        font-weight: bold;
        text-shadow: 0 /*{a-bar-shadow-x}*/ 0 /*{a-bar-shadow-y}*/ 0 /*{a-bar-shadow-radius}*/ #0a569c /*{a-bar-shadow-color}*/;
    Save file.
    Import back into ISE
    Get back to ISE.
    Open Advanced Customization/Export/Import Themes…
    Choose your file.
    Input your theme name.
    Click “Save”.
    Click “Save” theme (upon the “Language file”).
    Click “Portal test URL”.
    Enjoy your new background..
    Example of the CSS file, see attachments
    It is possible to upload portal files to the Posture Remediation repository and reference these files in custom javascript or CSS files.
    Recommendation is to use the relative path so you're not referencing a specific PSN
    Path to the uploaded files at Policy > Policy Elements > Results > Posture > Remediation Actions > File Remediation
    Relative: /auth/packages/<Package_Name>/<File_Name>Example: /auth/packages/Custom_Portal2/my-background3.jpg
    Absolute: https://psn_fqdn:portal_port/auth/packages/<Package_Name>/<File_Name>Example: https://ise13-psn1.cts.local:8443/auth/packages/Custom_Portal2/my-background.jpg

  • Gallery Demo... how to toggle background-image on playLabel

    Anyone? I'd like something besides the play/pause text --
    basically, using a background-image... how can I tap into whatever
    it is that toggles the text to get it to toggle the css instead?
    Any help appreciated, thanks!

    quote:
    Originally posted by:
    n2dreaming
    Anyone? I'd like something besides the play/pause text --
    basically, using a background-image... how can I tap into whatever
    it is that toggles the text to get it to toggle the css instead?
    here's a solution that seems to work for me:
    1) look in the gallery.js file and find the StartSlideShow()
    function
    2) Find the two instances of playLabel.firstChild.data=
    3) put a single space in there instead of play and pause
    4) create your graphics for previous, next, play and pause
    5) add IDs to your links in the #transport
    <li><a> (#nextLabel, #prevLabel, #playLabel)
    6) set up css rules to use your next, prev and pause graphics
    as background-images, using this format:
    #transport a#nextLabel:link, #transport a#nextLabel:visited {
    background-image: url(sharedimages/next.gif);
    background-repeat: no-repeat;
    background-position: center center;
    7) set up a :focus rule for a#playLabel:focus, (and :active
    for IE) to use the play background-image:
    #transport a#playLabel:focus, #transport a#playLabel:active {
    background-image: url(sharedimages/play.gif);
    background-repeat: no-repeat;
    background-position: center center;

  • Spry Menu Bar using CSS background image without losing submenu ( V) indicators

    Spry menu bar sets the down and side submenu indicators using
    a positioned background image. I have a requirement to use a
    specific background image yet must retain the > and v submenu
    indicators. Without having to generate full width custom background
    images for each of the menu item types to include the side and down
    menu indicators, is there anyway to use a generic background image
    and show the indicators using just CSS?

    Don't use reserved words in JS
    var event = new Spry.Data.XMLDataSet("events.xml", "catalog/event", {sortOnLoad: "date", sortOrderOnLoad: "descending"});
    event is such a reserved word. If you change this to event1 then all is well.
    I hope this helps.
    Ben

  • How do I remove background images from a PDF?  Using Adobe Acrobat 6.0 Standard.

    I have a file I need to print off, but the document is 100 pages lond and each page as a very obnoxious background image that makes it difficult to read the content, and I really don't want to waste the ink.
    I have tried a few things with no luck:
    -Tried replacing document background color in the 'Accessibility' tab in preferences.
    -Tried unchecking the 'Display large images' field in the 'Page Display' tab in preference - this leaves a dark gray background that I can't get rid of, which is almost as bad as the original image.
    -Tried several combinations under the 'Color Management' tab in preference to lessen the gray background achieved from the previous step.  I can only brighten the shade slighty, but there is still a fair amount of gray background.
    I just want a white background, or a clear background, and I have not seen any article or help topic on how to accomplish this.  Please help!
    Mike

    You might want to see if you can select the background with the object touchup tool. If so, can you then just delete the selected object. May take a while to go through the document, but if it solves the problem you are ahead. You may be able to select it with JavaScript and repeat the process. My point of using the object touchup tool is that it may not be a background set by Acrobat, but something that is simply labeled as an image from the Acrobat viewpoint.

Maybe you are looking for

  • Can't install Boot Camp on intended disk..

    This is frustrating.. I've recently put a second drive, an SSD, into my iMac (late 2009) and am now trying to install Windows on the HDD. Boot Camp simply will not let me install a new partition on any other drive but the SSD. I've even gone so far a

  • To find name for standard smartform of purchase order in Tcode me21n.......

    Please do not offer rewards Hi Abapers,              I had doubt, regarding how to find the name of standard smartform available for purchase order in tcode - ME21N.           After executing ME21N, n print preview i get a form without logo. So i wan

  • CLM - Maximum File Size for Contract Documents

    We did a search but did not find an answer for this.  For the CLM system does anybody know SAP's recommendation on the maximum file size that the application can reliably handle for contract documents?  We recently increased the maximum file size fro

  • Trouble using iTunes Radio

    I have a subscription to iTunes Match. When playing a station I created in iTunes radio, after a few songs, the radio stops and I get an error that says: 'We could not complete your iTunes store request. You are not authorized to access the requested

  • MSS+ Compensation Information+ Salary Data

    Hello Consultants, I have a serious query and I would be really thankful to you if you can provide me some assistance in resolving the following error. In MSS under team there is a node of compensation Information. on clicking that we get to see the