Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.


Results 1 to 2 of 2

Thread: Quick help please deadline in a few hours

  1. #1

    Quick help please deadline in a few hours


    I've been up all night trying to finish a piece of work, but there's just one thing which I'm stuck on.

    Basically, I have a set of 3 galleries on 3 separate frames which are controlled using the flash slider component.

    When each photo is selected, a piece of audio also plays.

    That all works fine.

    However, the problem is removing the gallery after it has been displayed on the page.

    What I've got at the moment is a code which makes the gallery not visible on the page when it shouldn't be there.

    This is fine, but when you go back to click on the gallery, it goes back to its original state, which basically messes up the whole thing as everytime a new picture loads you see the other picture in the background.

    First frame actions:

    import flash.events.MouseEvent;import flash.media.SoundMixer;
    gallery_mc.visible = false;
    slider.visible = false;
    gallery_mc2.visible = false;
    slider2.visible = false;
    gallery_mc3.visible = false;
    slider3.visible = false;
    //navigation buttons
    btn_home.addEventListener(MouseEvent.CLICK, nav1Button);
    btn_about.addEventListener(MouseEvent.CLICK, nav2Button);
    btn_contact.addEventListener(MouseEvent.CLICK, nav3Button);
    btn_sounds.addEventListener(MouseEvent.CLICK, artefact1Button);
    btn_journey.addEventListener(MouseEvent.CLICK, artefact2Button);
    btn_journey2.addEventListener(MouseEvent.CLICK, artefact3Button);
    //navigation button functions
    function nav1Button(evt:MouseEvent):void
    	slider.value = 0;
    function nav2Button(evt:MouseEvent):void
    function nav3Button(evt:MouseEvent):void
    function artefact1Button(evt:MouseEvent):void
    function artefact2Button(evt:MouseEvent):void
    function artefact3Button(evt:MouseEvent):void
    gallery1 page actions

    import flash.events.Event;import flash.media.Sound;
    import flash.media.SoundChannel;
    gallery_mc.visible = true;
    slider.visible = true;
    gallery_mc2.visible = false;
    slider2.visible = false;
    gallery_mc3.visible = false;
    slider3.visible = false;
    //array for sounds
    var sound_array:Array = ["sounds/bus-stop.mp3", 
    //array for images
    var img_array:Array = ["images/bus_stop.jpg",
    slider.minimum = 0;
    slider.maximum = sound_array.length - 1;
    slider.snapInterval = 1;
    slider.tickInterval = 1;
    //sound channel variable
    var sound:Sound;
    var s_channel:SoundChannel;
    //image loader variable
    var imageLoader:Loader = new Loader();
    //creating an event when the slider value is changed
    slider.addEventListener(Event.CHANGE, slider_onChange);
    //function for slider value changing
    function slider_onChange(event:Event):void {
        sound = new Sound();
        sound.load(new URLRequest(sound_array[slider.value]));
    	var image:URLRequest = new URLRequest(img_array[slider.value]);
    		gallery_mc.addChild (imageLoader);
    		imageLoader.x = 161.5;
    		imageLoader.y = 141.45;
        if(s_channel != null) s_channel.stop();
        s_channel = sound.play();
    	trace (slider.value);

    Can anyone please help point me in the right direction?

    I can provide source files if necessary.


  2. #2
    Can you provide the source files and explain the problem in a bit detail. I will check it in my free time and get back to you.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Home About kirupa.com Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012