Scoping Question when one movie loads a second movie

I have a movie that is just a preloader for the main movie.
This preloader movie has the loader and progress bar components so
that I can show the process of the main movie loading. When I load
a sound file in frame 1 of the main movie to be used later in the
movie and run the main movie (with out being called from the
preloader movie) the sound will play when it is called (told to
play). However if I call the main movie from the preloader movie,
the sound will not play. To make the sound play I have to load the
sound in the preloader movie.
I am sure that this is a scoping problem and I am not correctly
coding for the location of the sound.
The code for loading the sound is :
if(_global.Behaviors == null)_global.Behaviors = {};
if(_global.Behaviors.Sound == null)_global.Behaviors.Sound =
if(typeof this.createEmptyMovieClip == 'undefined'){
this._parent.createEmptyMovieClip('BS_sndErrorMsg',new
Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000)
_global.Behaviors.Sound.sndErrorMsg = new
Sound(this._parent.BS_sndErrorMsg);
} else {
this.createEmptyMovieClip('_sndErrorMsg_',new
Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000)
_global.Behaviors.Sound.sndErrorMsg = new
Sound(this.BS_sndErrorMsg);
_global.Behaviors.Sound.sndErrorMsg.attachSound("ErrorMsgSound");
if (false) {
_global.Behaviors.Sound.sndErrorMsg.start(0,1);
The code to play the sound is:
_global.Behaviors.Sound.sndErrorMsg.start(0,1);
I would like to keep the preloader movie as small as possible
and don’t want to load any sound files in it.
How do I load the sound files in the main movie and play them
when needed (using actionscripts) from the main movie when the main
movie is loaded from the preloader movie?
Thank you,
Steve

Putting the following code on frame one in the movie being
loaded by the preloader corrected the problem.
this._lockroot=true;
The following is what Flash 8 help file says about
_lockroot
_lockroot (MovieClip._lockroot property)
public _lockroot : Boolean
A Boolean value that specifies what _root refers to when a
SWF file is loaded into a movie clip. The _lockroot property is
undefined by default. You can set this property within the SWF file
that is being loaded or in the handler that is loading the movie
clip.
For example, suppose you have a document called Games.fla
that lets a user choose a game to play, and loads the game (for
example, Chess.swf) into the game_mc movie clip. Make sure that,
after being loaded into Games.swf, any use of _root in Chess.swf
refers to _root in Chess.swf (not _root in Games.swf). If you have
access to Chess.fla and publish it to Flash Player 7 or later, you
can add this statement to Chess.fla on the main Timeline:
this._lockroot = true;
If you don't have access to Chess.fla (for example, if you
are loading Chess.swf from someone else's site into chess_mc), you
can set the Chess.swf _lockroot property when you load it. Place
the following ActionScript on the main Timeline of Games.fla:
chess_mc._lockroot = true;
In this case, Chess.swf can be published for any version of
Flash Player, as long as Games.swf is published for Flash Player 7
or later.
When calling loadMovie(), set the MovieClip._lockroot
property to true in the loader movie, as the following code shows.
If you don't set _lockroot to true in the loader movie, any
references to _root in the loaded movie point to the _root of the
loader instead of the _root of the loaded movie:
myMovieClip._lockroot = true;
Availability: ActionScript 1.0; Flash Player 7

Similar Messages

  • Jasper report on HTML when one image loaded from database and for the other

    How to generate jasper report on HTML when one image loaded from database and for the other we give a image path
    My code
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
              exporter = new JRHtmlExporter();
              exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
              exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos);
              exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, strImageInputDirectory);
         exporter.setParameter(JRHtmlExporterParameter.IMAGES_DIR_NAME, strImageOutputPath == null ? "." : strImageOutputPath);
         exporter.setParameter(JRHtmlExporterParameter.IS_OUTPUT_IMAGES_TO_DIR, Boolean.TRUE);
         exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, Boolean.FALSE);
         exporter.setParameter(JRHtmlExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);
              exporter.exportReport();
              byte[] bdata = ((ByteArrayOutputStream) baos).toByteArray();
    Can any one help pls
    Message was edited by:
    ameet.au

    hey sorry for posting it in this forum.
    but do u have sample code for making it work.. since i am able to do it on PDF format(image from Database and another stored in the webserver) using
    byte image[] =(byte[]) outData.get("image");
                        ByteArrayInputStream img = new ByteArrayInputStream(image);
                        hmimg.put("P_PARAMV3", img);
    print = JasperFillManager.fillReport(reportFileName, hmimg, jrxmlds);
    bdata= JasperExportManager.exportReportToPdf(print);

  • Embed question - play one movie after another

    I am trying to figure out how to play a short 10 second clip before each movie on my website. The clip may be a short ad or a promo and will depend upon the content of the main video. What is the code that enables you to play one move after another in a web page. I don't want to edit the two clips to become one cos over time the ads and promos will change. In Realplayer I remember using SMIL but how is it done in QT. I will eventually write code to write out the Embed tag but now i am just experimenting. Here is what my drupal site puts out
    <!-- start main content -->
    <!-- begin content -->
    <!--[if !IE]> <-->
    <object type="video/quicktime" width="483" height="381"
    data="http://www.1234567.com/files/videos/Mpeg4TestSnapX-480x360.mp4">
    <!--> <![endif]-->
    <!--[if IE]>
    <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="483" height="381" scale="tofit" >
    <![endif]-->
    <param name="src" value="http://www.1234567.com/files/videos/Mpeg4TestSnapX-480x360.mp4" />
    <param name="AUTOPLAY" value="true" />
    <param name="KIOSKMODE" value="false" />
    Your browser is not able to display this multimedia content.
    </object>
    Problems viewing videos?
    Download latest Quicktime Player

    Embed the initial movie clip as normal, but give it an HREF property.
    Set the source for the HREF to be the next movie, set autohref=true, and set target="myself". It's the same technique you use to build a poster movie but (a) instead of having the poster movie open QT Player, you have its target open in its own frame and (b) instead of waiting for a user to click the poster, you have the poster movie "click itself".
    Code that I used a very long time ago to display a "Loading..." graphic as a movie loaded (waste of effort, actually, as the movie is fast start and loads very fast):
    <embed
    src="loading.mov"
    height="208"
    width="256"
    autohref="true"
    href="Worm.mov"
    target="Myself">
    </embed>
    (of course this was before I learned about OBJECT and the need to use OBJECT to activate the ActiveX control in IE. Also, it's worth noting that the javascript hack isn't strictly necessary for IE users, but without it, IE users will get a security dialog before they get the movie.)
    The code above can be found on:
    http://capital2.capital.edu/admin-staff/dalthoff/adventures/worm.html
    --Dave Althoff, Jr.

  • Why is it when I download music to my iTunes an explanation mark comes up on some of my music. And another question when I move some music to my iPod I can not play it because this little circle comes up

    Why is it when I am downloading my CD's to my computer some of my music gets an explanation mark next to it.
    Second question
    When I can download music to my iPod some of the music downloads but I can not play it because it has this little round circle in front of it ansd the music is greyed out and not black lettering like the other songs I can play.
    Please help

    katenater wrote:
    Thank you now how do I get the songs on to the flash drive?
    Insert the flash drive into the other computer, and open it so it looks like a window.  Highlight the songs you want in his iTunes, and drag them into that window.
    That will cause them to copy onto the flash drive, and will not affect his library.
    If you normally run iTunes in full-screen mode, make it smaller so that you can do the drag.
    Then insert the flash drive into your computer.  Find your Automatically Add to iTunes folder (it is inside the iTunes media folder) and drag the songs into it.

  • How can I get my audio to move down when I move my video up without making two separate moves?

    Hey
    I have moved to Premiere as a lot of the companies I edit for are now using it. Overall impression is GREAT especially CC vs 5.5 which I started in.
    In relation to my question, when I move my video track up a layer my audio stays on track 1 or whereever it started. This is really frustrating as it overwrites the exsiting audio when I move it.
    Is there are workaround other than moving the audio down first then moving the clip along, I find this slows me down a lot.
    Is this coming out in a new update, or is there a quick solution i missing?
    I am about to head into 8 days of fast turnaround multi cam editing so any help would be appreciated.
    Thanks
    Piers Faircloth Harding

    I understand that side of it, its a feature which I was used to in FCP and now I dont have it so was wondering if CC has this feature.
    In realation to audio not caring what layer it is on you are correct but if I want to shift it with my video to a different layer it is a labourous task when editing under pressure in time sensitive situations eg onsite VNRs for events where you have to have ambient bg or when you want ambient from b roll over talking to have to shift it down separately before moving your clip to avoid overwriting exsisting.

  • TS1463 I downloaded 3 movies to watch on my IPOD Classic.  One movie went to the IPOD but the other 2 said they couldn't load.  Why would this happen?  I am wanting to watch the movie when I travel and not on my computer at home.

    Why can't I download a movie onto my IPOD Classic?  One movie downloaded by 2 only went to my computer.  Can I get a refund?

    An iPod classic can generally play video files up to 640 by 480 pixels.  The iPod's screen is actually 320x240 pixels, but it will play 640x480 videos (that are in a compatible format).
    However, "HD" (high def) videos are at a higher resolution than 640x480.  Apple often provides both the HD and SD (standard def) versions of the video, when you download it.  The SD version should work with iPod classic.  If a video is in HD only, it won't play on iPod so you can't sync it to iPod.
    There is a command in iTunes to convert the video.  Select video on the iTunes library list.  Go up to Menu Bar.  Under Advanced, select Create iPod or iPhone Version.  After converting completes (which can take some time), try syncing that version to your iPod.  NOTE: Some videos in iTunes may not allow conversion due to copy protection (DRM).

  • Hello ...  I have a problem with a wifi connection speed on my mac pro ... the problem is that in one room the internet opening for the websites is extremely slow ... but when i move the mac pro somewhat to other location ... the internet speed increase

    hello ....
    my connection problem on my mac pro is :
    that when i try to open a website on safari .... it delays ... and takes more than 30 seconds to open completely ...
    but when i move the mac pro to another location ... its internet opening speeds up ....
    also in one room ... web opening delays .... but on other rooms it is normal
    so what can i do to solve this problem ....
    Note : also when i hold it up and move in the same room ... the speed changes and somewhere speed up ... and in another location speed down ..
    thanks for you all ...
    Waiting for your support ... as quick as possible ...

    WiFi signals get stronger the closer the machine is to the router and the less interference/blocking of the signal like via walls with metal in them or of thick concrete.
    Since the signal emanates outwards in a sphere, your supposed to place the wireless router in a central location in the building so it covers all areas.
    The power of the router also has a affect, if your router is old or something not that powerful like a Airport Express, it doesn't have the ability to filter out other signals or enough punch to get through walls etc. or cover a large area as effectively.
    If you buy/have a powerful router of newer make and have issues where there is metal in the walls or thick concrete, then you can buy something like OpenMesh and by using Ethernet cables from the back of the router, extend the WiFi signal into other rooms and areas past the blockage.
    https://www.open-mesh.com/

  • Hi there. I have a problem with sound on my 4s. When you move the volume slider up, it sounds well. But when I move the volume slider down I will hear barely and unclear sound in my headphone.I tried different headphones but result is same as old one.Help

    Hi there. I have a problem with sound on my 4s. When you move the volume slider up, it sounds well. But when I move the volume slider down I will hear barely and unclear sound in my headphone.I tried different headphones but result is same as old one.Help

    Try A and B
    (A) Restart iPad
    1. Hold down the Sleep/Wake button until the red slider appears.
    2. Drag the slider to turn off iPad.
    3. Turn iPad back on, hold down the Sleep/Wake until the Apple logo appears
    (B) Reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • Need buttons on base movie to become inactive when external movie loaded

    Hi,
    I am working on a portfolio website and I have all my navigation with buttons linking to other pages, on the base level. All the buttons are  scattered around the stage and when one of these buttons is clicked an external movie is loaded in the centre of the page.
    The movie is a big white box with a slideshow of images from my portfolio in the centre of the stage.
    My problem is that the buttons on the base level are easily clicked by accident, even though you cant see them with the white box.
    Is there anyway I can stop the base movie clip working, once a button is clicked? When the user has finished looking at my slideshow images then they press a close button.
    Code used for button on main timeline:
    swfBtn.onRelease = function()
        loadMovieNum("graphicLayouts.swf", 1);
    Code used for Close button on external swf:
    on (release) {
         unloadMovieNum(1);

    In your case I'd recommend writing the said above two function on main timeline. It should go something like this:
    function enableBtns():Void
         BTN_1.enabled = true;
         BTN_2.enabled = true;
         // ... and so on
    function disableBtns():Void
         BTN_1.enabled = false;
         BTN_2.enabled = false;
         // ... and so on
    Now, in the function where you call the loadMovie method (it's on the main timeline, right) just write:
    disableBtns();
    And in the external swf file, where you unload your swf write:
    _level0.enableBtns();
    It should work if I didn't bug anything.

  • Why is my tabbed panel defaulting to the third tab, instead of the first one, when my page loads?

    I have a tabbed panel widget on the home page of our website and it is essential that the audience views the content on the first tab when the page loads.
    Thereafter they can click on the other tabs to view content. I have tried using "Arrange" "Bring to Front" by clicking on the object in the layout and also physically dragging the elements in the layers panel [i.e. re-arranging the order of the layers], however the panel view just keeps reverting back to the third panel which is the first in my layers list. When I try to drag this down to the bottom of my layers for this composition the first panel moves physically in the layout to the third panel.
    The idea is to have the one currently showing at the bottom, "Data Centre..", ALWAYS showing on the top and the one currently showing on the top, "Engineering &.." , ALWAYS showing on the bottom. As I said before, physically re-arranging the order of the layers is not working either.

    Me too. Anyone else got this problem?
    I have 3 panels and no matter how i order the layers it always loads the right-most one first

  • Playing a mp3 when a movie clip loads

    I am using Adobe Flash Professional CS6
    What I am trying to do is play a mp3 file that I have in my library when the clip loads and stop playing it when the a new clip is selected from the menu I created.  On the button that loads the movie clip (Instance name: Slideshow), I have the following code:
    [code]
    on (release){
        gotoAndPlay(120);
    onClipEvent (load){
        mySong = new Sound();
        mySong.attachSound("MastersThisHall");
        mySong.start(0,50);
    onClipEvent (unload) {
        mySong.stop();
    [/code]
    - I went to the properties of the MastersThisHall.mp3 file in my library,
    - Selected the "ActionScript", tab,
    - Checked the box that says "Export for ActionScript",
    - Unchecked the "Export in frame 1" check box, and
    - Added MastersThisHall in the "Identifier" field.
    The sound is NOT playing when I when the "Slideshow" button is pressed.
    Ideas?

    Thank you for all of this; it is very helpful.
    I have series of 6 buttons I created, each of them load a different movie clip. I need to have the music from the slideshow NOT continue to play when a new movie clip is selected.
    I have the following code.
    Frame 1:
    SlideshowMusic = new Sound(this);
    SlideshowMusic.attachSound("MastersThisHall");
    stop();
    Frame 120 (attached to the Slideshow movie clip object):
    onClipEvent (load) {
        SlideshowMusic.play();
    The "Mute" Button:
    on (release) {
        SlideshowMusic.setVolume(0);
    The "Resume Sound" Button:
    on (release) {
         SlideshowMusic.setVolume(100);
    And the "Pause" Button:
    on (release)
      if (SlideshowMusic.position < SlideshowMusic.duration)
        SlideshowMusic.start(SlideshowMusic.position / 1000);
    It is loading and working perfectly. However, I have two more questions:
    1. How do I make the the sound automatically stop when a new movie clip is played?
    2. How do I change the "pause" symbol to the "play" symbol when the "Pause" button is pressed?

  • Quick question: When are xib files loaded?

    As applications grow in scope and interface breadth, I wonder if separating out optional interfaces into different nib files could improve performance.
    I can't tell if it does, however, or if it supports multiple nib files per project just for organization or something.
    If it does, does it:
    -Only load the nib after the object is initialized?
    -Only load the nib after the object is visible?
    -Load the nib file multiple times for different object instances? Redraw it or something?
    What is the primary performance hit for nib files? Their size, graphical complexity (opacities and stuff), something else?

    NIB files are full of archived objects. Using the initWithNib: method of a viewController and remembering to release an IBOutlets in the dealloc method will insure proper memory handling. To get to your question, when you load a NIB it will bring all objects in that NIB into memory. So if you design your whole interface in one NIB, then you are requiring the entire interface to load at once. The main reason to split your interface into multiple NIBs is to avoid this hit. This is more of an issue on the iPhone than on a Mac, but the principle is still the same. And if you create multiple viewController objects and initWithNib: them, then you will have multiple copies in memory. Likewise if you use the NSBundle class to explicitly load NIBs, each load call will create new objects. So if you have an interface element you reuse a lot, you can load it from one NIB many times. But the memory comment still holds true -- each load allocates memory for the NIB objects.

  • Importing a velocity vector when blending moves on one axis

    I have altered the template of 'Sequence of Blended One-Axis Moves' such that it imports a vector of moves, but am trying to also import a vector of varying velocity values to accompany each position value that is input into the program. I have tried moving the velocity input into the loop as well with no success. Any suggestions?

    Dear Iaf3g,
    Have you tried creating an array of Velocities corresponding to the Target Position Array and then auto-indexing it into the while loop much the same way as the Target position array? Then you could input a different velocity to the Load Velocity VI each iteration of the loop. You also need to make sure that both the Load Position and Load Velocity VIs execute before the Start Motion VI, and you can ensure this by the way you route the error wires. It sounds like you tried something similar to this. Why didn't it work? What errors were you getting when trying to load velocities in this way?
    Best Regards,
    ~Nate

  • When I move mouse on Firefox-History (it must show context menu) he just begins to think, and after ~20 seconds he looks like I haven't pressed any buttons! I tried to turn off all addons but it doesn't help. Also he "thinks" everytime when gets download

    when I move mouse on Firefox-History (it must show context menu) he just begins to think, and after ~20 seconds he looks like I haven't pressed any buttons! I tried to turn off all addons but it doesn't help. Also he "thinks" everytime when he gets new downloading and sometimes on pushing Bookmarks

    Try running Firefox in [[Safe Mode]]. If it functions properly in that configuration, then one of your add-ons is the culprit.

  • Having arranged some scanned pictures in an album in I-Photo how can I keep them in the order I have chosen when I move the album. They all have the scan date and not the taken date and move to new positions if I move them from one album to another.

    Having arranged some scanned pictures in an album in I-Photo how can I keep them in the order I have chosen when I move the album. They all have the scan date and not the taken date and move to new positions if I move them from one album to another.
    Is there any way to re-number them in the order I have chosen so that they can then be sorted by number? The scans are all from pre-digital images that I wish to move to a photobook and I don't want to have to organise them twice!
    Thanks for any suggestions.

    I was a bit short, Chris, sorry. It is limited, what can be posted, when typing on an iPad.
    Now I am back on my Mac. I meant the following:  Batch Change the date for a large range of photos, that should have a date stepped in increments.
    Select all Photos at once and use the command "Photos > Batch Change".
    Then set the date for the first photo and select an increment, e.g. one minute.
    Now all photos will get a new date assigned, incremented by one minute, in the sequence you have selected. So you will be able to sort them by date.  This way it will be unnecessary to change the titles or filenames.

Maybe you are looking for