The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


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

    Hi,


    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:

    Code:
    import flash.events.MouseEvent;import flash.media.SoundMixer;
    
    
    stop();
    
    
    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
    {
    	gotoAndStop("home");
    	slider.value = 0;
    	SoundMixer.stopAll();
    }
    
    
    function nav2Button(evt:MouseEvent):void
    {
    	gotoAndStop("about");
    	SoundMixer.stopAll();
    }
    
    
    function nav3Button(evt:MouseEvent):void
    {
    	gotoAndStop("contact");
    	SoundMixer.stopAll();
    }
    
    
    function artefact1Button(evt:MouseEvent):void
    {
    	gotoAndStop("soundsOfPort");
    	SoundMixer.stopAll();
    }
    
    
    function artefact2Button(evt:MouseEvent):void
    {
    	gotoAndStop("journey");
    	SoundMixer.stopAll();
    }
    
    
    function artefact3Button(evt:MouseEvent):void
    {
    	gotoAndStop("journey2");
    	SoundMixer.stopAll();
    }
    gallery1 page actions

    Code:
    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", 
    					 "sounds/church.mp3", 
    					 "sounds/sea.mp3", 
    					 "sounds/dog.mp3"];
    
    
    //array for images
    var img_array:Array = ["images/bus_stop.jpg",
    					   "images/church.jpg",
    					   "images/dog1.jpg",
    					   "images/dog3.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]);
    		imageLoader.load(image);
    		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.

    Thanks!

  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.

    Thanks
    Sateesh.J

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

 Credits

Copyright 1999 - 2012