[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 413
  • Last Modified:

Losing volume control when loading swf into another movie.

I have built a swf movie for video playback and volume control which works fine when played alone. When I load this external SWF file into another movie I am loosing my volume control. here is the code I'm using for volume control:
-------------------------
var s:Sound = new Sound();
s.setVolume(100);
mc_soundLevel.mc_bar._yscale = 100;

mc_soundLevel.onPress = function() {
      volumeTo = (this._ymouse / this._height)*100;
      this.mc_bar._yscale = -volumeTo;
      s.setVolume(volumeTo);
}
----------------------------
Ideas/help appreciated

Rip
0
ripnoel
Asked:
ripnoel
  • 4
  • 3
1 Solution
 
ZefferCommented:
try adding..
this._lockroot = true;
Z
0
 
ripnoelAuthor Commented:
Does nothing no matter where I place it...other ideas?
0
 
ZefferCommented:
volumeTo: Number = (this._ymouse / this._height)*100;
Z
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ripnoelAuthor Commented:
I'm really not sure what you are suggesting...have you looked at my original code? The issue I'm trying to address is NOT trying to get it to work BUT to get it to work when imported into another flash movie. Works fine stand alone.

My code:
------------------------

var s:Sound = new Sound();
s.setVolume(100);
mc_soundLevel.mc_bar._yscale = 100;

mc_soundLevel.onPress = function() {
      volumeTo = (this._ymouse / this._height)*100;
      this.mc_bar._yscale = -volumeTo;
      s.setVolume(volumeTo);
}
0
 
ZefferCommented:
Yes looked at your code..It just that it's a mix of AS1 and AS2 and if you are importing it into a swf exported as AS2 the imported clip may fall over as the parent clip's attributes are inherited by the imported clip..frame-rate etc.
anyway..try the following with reference to the clip rather than default reference to _root (which is why I suggested _lockroot in the clip)..

var s:Sound = new Sound();
s.setVolume(100);
this.mc_soundLevel.mc_bar._yscale = 100;

this.mc_soundLevel.onPress = function() {
      var volumeTo:Number = (this._ymouse / this._height)*100;
      this.mc_bar._yscale = -volumeTo;
      s.setVolume(volumeTo);
}

Z

0
 
ripnoelAuthor Commented:
Already tried this and tried it again to no avail. I feel I need to put a volume controller on the main movie timeline (and just below my video) where I have a music player there already. Can you provide some proper code I can add in to this area as an overall volume controller?

Thanks,

Rip
0
 
ZefferCommented:
if you loaded it in using loadMovieNum to level3 you could put code on the maintimeline eg..

public setVolume(value:Number) : Void
var movieSound:Sound = new Sound(_level3);

and on a button or in a function..

movieSound.setVolume(0);

if you want a button in the swf code is..

_parent.movieSound.setVolume(0);

Z



0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now