Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Create Flash Wrapper For Volume



Hello,

I am curious as to how I could create a flash wrapper to disable/turn the volume to zero of a flash object such as a YouTube video. Can this be done? Any code/documentation would be greatly appreciated, thank you all for your time!

C



DevShed > Flash Help
Posted on: February 25th, 2008, 06:19 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Flash Wrapper
I'm just wondering how I would go about making a flash wrapper, that would go around an already existing flash program and do things with it such as modify it's volume.

Any help would be appreciated immensely.

Thanks
C

Flash Wrapper For Windows Media
Can someone point me to a tutorial or examples of how to create a Flash wrapper to post Windows Media (or other type) movies online?
Thanks

How Can I Create This Volume Slider?
Hello,

I'm looking for some advice on how to create the volume slider found on http://www.janemonheitmusic.com. I like how you can drag the volume up/down and that it changes color. How can I do this? I've read tutorials on how to create a simple slider. How can I make a slider that affects the color of the bars? Is there a mask involved with this? Any advice or .fla is helpful!

Thanks!

How Can I Create This Volume Slider?
Hello,

I'm looking for some advice on how to create the volume slider found on http://www.janemonheitmusic.com. I like how you can drag the volume up/down and that it changes color. How can I do this? I've read tutorials on how to create a simple slider. How can I make a slider that when the volume changes, the slider changes color? Any advice or .fla is helpful!

Thanks!

Create Volume Spectrum Analyzer
Like the one used in Winamp. I wanna know how you do it using actionscripts and a movie clip. Thanks in advance.

How Can I Create A Round Volume Button
I'd like to make a volume button like radio has. How coul'd I do it in flash?

How To Create A Volume Adjuster Just Like An Ipod?
http://www.freewebs.com/porcupinestu...nedesigns.html

here is the url of my site, still under construction. this is my question, notice on my site. there is a music player, just like an ipod, everything is going fine, the only thing missing is on how can i create a volume slider similar to an ipod in real life. ir its possible that is

Flash 8 FLV Playback/Custom UI Volume Components With Global Volume Control
I'm creating a multi-scene swf with several FLV Playback - Player 8 Component videos on different scenes/frames.

I want to use the FLV Playback Custom UI Volume Bar so that when a user makes a volume adjustment during one FLV Playback viewing that volume adjustment will remain throughout the other FLV Playback video viewings.
This will prevent the viewer from having to make volume adjustments for each viewing. However, I want to enable the volume change to be made and changed at any time throughout any of the video viewings. Another aspect of this is that the FLV Playback Component has a volume setting that would have to be overridden by the global custom UI volume setting.

Is this possible? If so, how would this be done?

Thanks!

James
jamesk@pacificmm.com

Flash Wrapper Quick Flash Loading
I've got 12 flash animations used throughout my site (each 150 X 150 pixels). Each one is 5 to 35 KB in filesize. I've read that the best way to serve the animations is to embed a <1k animation. That small file would be coded to load the actual swf file.

My knowledge of actionscript is rated at zero, and I have had difficulty finding an answer to my simple question.

Flash "wrapper" Around A YouTube Video Player?
Can someone tell me what is causing my Flash file to be incapable of playing a YouTube video? What I have created is basically a Flash "wrapper" that embeds a YouTube SWF file inside an object. When I compile the SWF and play it within an html file on my local computer, all is well. However, when I upload the same file to my server, the video refuses to play.

When I view the LiveHttpHeader logs, we see calls to a crossdomain.xml file:

<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>


So it appears that the cross-domain isn't the problem - - - it's set to allow playback on non-YouTube sites.

Any thoughts on the matter are greatly appreciated.









Attach Code

Security.loadPolicyFile("crossdomain.xml");

var embedme:String = "http://www.youtube.com/swf/l.swf?video_id=hVkEHBbv4Fg&rel=1&eurl=&iurl=http%3A//i.ytimg.com/vi/hVkEHBbv4Fg/default.jpg&t=OEgsToPDskLXySocnkEWAaWqA5rvjkmb&hl=en";

var movieGetter:Loader = new Loader();


movieGetter.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded, false, 0, true);
movieGetter.load(new URLRequest(embedme));

function loaded(evt:Event):void
{
var textfield:TextField = new TextField();
textfield.text = "see if this loads...
";
textfield.x = 50;
textfield.y = 50;

addChild(textfield);



addChild(evt.target.content);

textfield.text = "made it past video getting added";

}

[F8] Word Wrapper Again
Thanks so much for the guidance I received so far. I've spent the day learning about forms and I've found info on email forms, guest books, getting URLs from a form--but all of these seem like way more than what I need. If anyone has any suggestions (even in telling me what to study) I'm very grateful. All I need is an input box on the left where people can type in words (many words, if they'd like--but one word per line) and then a submit button. Then on the right, I'd like the return to be those words now with quotes or brackets around them.

Example:

hat
dog
cow

(submit button) returns:
"hat" (etc.)

or in the case of brackets: [hat]

I've seen this done in CGI, but I'd like to do it in flash. It seems like I just need the input action to put quotes or brackets around whatever word is entered and return it on the right in another box the user can copy and paste from.

I'm planning to keep studying about this, but as I go through all the flash manuals, I keep getting the feeling what I'm studying is way more complex than this simple action. =)

Thanks again. I'll post a .fla if I get that far. =)

Apryl

[CS3] Using Preloader Through Wrapper?
Hi All!

A very noobie question... I'm attempting this preloader from http://monkeyflash.com/tutorials/custom-preloader/ to 'preload' an animation file (.swf) file that im doing, as per the bottom section of that tutorial:

"What about loading the entire movie?

How can you use this same technique to load the entire SWF file and not an external asset? One way is to create a “wrapper” swf that only contains your preloader and the code above. You can then load your main SWF file into this wrapper container, and avoid the need to add a preloader to an already-completed Flash file. This is a very efficient and easy way to add a preloader to any site."

Being a noob, i've got no idea what this means. can someone maybe point me in the right direction? Any help apperciated!!

Thanks in advance!

Any Way To Block A SWF Wrapper?
Hello. Some users of our flash apps are defeating copyright protection and
security measures (such as custom context menus) by using a "loader.swf"
as a wrapper. The only contents of the wrapper are something like:

loadMovieNum(ourapplication.swf, 0);

Is there any way to prevent our flash apps from being loaded into such a
wrapper or to make it automatically "break out" of such a wrapper? Any help
or advice would be greatly appreciated. Thanks!

JOSH

Sprite Wrapper?
I am writing all my code using as3. I have buttons that consist of rectangles, text, and an invisible hit area. I have written out each element individually. Is there a way to put them all in one container so I can say button.visible = true and it knows to show or hide all of my elements of my button?

Wrapper Not Wrapping?
I have this "wrapper2" in my page wich does not seem to wrap correctly.
http://www.agilitygraphics.com/clients/ceres/green.html

It should hold both the div called "content" and the div called "right"
but it does not seem to do that, plus it seems like it goes to high also.

I added this at the bottom:
<br style="clear:left;" /> and now seems to look right in DW, but once I
check it in the browser, I have issues.

What am I doing wrong?

Thank you!

Flickr API Wrapper
I'm trying to get a photogallery to get information directly from flickr.com

I've found a flash API wrapper that looks like it should work but my understanding
of class constructs is too weak to get it going.

http://kelvinluck.com/projects/flash...pper-for-flash

Has anyone else had a go at this??

Wrapper Preloader
Currently I'm teaching myself how to best create 'All flash' websites,
I've been looking through the web trying to find out the best way to create preloaders in AS3, from which I've found a few different methods.
Due to not being confident enough with my AS3 skills, I opted for the wrapper .swf method. Where an independent swf is created to load in the main movie, with a preloader inside that. It works just fine, it's seamless, attractive and efficient ( sizes up at 9kb ).
But one thing I was wondering,
My movie now uses three tiers of URL loaders. One for the wrapper to load the main page. and several inside that to load independent page modules.
I was wondering if anyone could give good advice on lessening CPU load created by this. ( I presume that tiers of URLloaders would wreak havoc for efficiency. )
Is what I've done a bad idea for my site?
And should I get comfortable with doing it this way?
I hear people generally use either:
A Loader in the DocClass. ( A procedure I'm not too familiar with. )
A wrapper SWF
or a loader in the first frame.

Could anyone explain which is the best for what application?

Thanks in advance.

Loading An FLV Into A SWF Wrapper
Hi All!

I'm having trouble with something that I hope someone can help me with. Basically I'm trying to load an flv into a wrapper swf which contains the FLVPlayBack component.

I'm using the html code below (given to me by someone), but I'm not sure how I tell my FLVPlayBack component to pull the GET data and load it into the player.

If someone could tell me the actionscript to do this that would be fantastic!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>hello</title>
<script src="AC_RunActiveContent.js" language="javascript"></script>
</head>

<body>

<script src='AC_RunActiveContent.js' language='javascript'></script>
<!-- saved from url=(0013)about:internet -->
<script language='javascript'>
AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/s...ersion=9,0,0,0', 'width', 500, 'height', 500, 'src', ((!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0)) ? 'player8' : 'player'), 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'id', 'flvPlayer', 'allowFullScreen', 'true', 'movie', ((!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0)) ? 'player8' : 'player'), 'FlashVars', 'movie=/test/get_video.flv&bgcolor=0x051615&fgcolor=0x13ABEC&vo lume=100&autoload=on&autorewind=on');
</script>
<noscript>
<object width='500' height='500' id='flvPlayer'>
<param name='allowFullScreen' value='true'>
<param name='movie' value='player.swf?movie=/test/get_video.flv&bgcolor=0x051615&fgcolor=0x13ABEC&vo lume=100&autoload=on&autorewind=on'>
<embed src='player.swf?movie=/test/get_video.flv&bgcolor=0x051615&fgcolor=0x13ABEC&vo lume=100&autoload=on&autorewind=on' width='500' height='500' allowFullScreen='true' type='application/x-shockwave-flash'>
</object>
</noscript>

</body>
</html>

Thank you in advance
Splash

How To Use MovieClip As A Wrapper?
Hi there,

I hope someone here can explain on how does a movieClip become a wrapper on a navigational sys??

I read the course outline of Macromedia on Flash Basic and under building a Navigational sys there was a sub-category on "Using a MovieClip as a wrapper".

Just confused on that part.

Thanks and more power to this site!

Yet Another R. Penner Wrapper
Last edited by RAMPAGE201 : 2002-07-23 at 07:37.
























This is a piece to a larger project that I am working on. You should have the robert penner easing functions in a library indicated.

you can get the library on his page or my home page points to it. (under open source.)
http://www.nebulouscore.com/

The general idea:
ABS -- tween from an absolute begin, end value;
REL -- gets the current property value to fill in the start/end(b,c) values needed for the penner function

the result.flag indicates whether the tween has reached the desired value.


Code:
#include "..librarypennerEasing.as"

function PennerABS (pfunc, beginVal , endVal, duration) {
this.pennerFunc = pfunc
this.t = 0
this.b = beginVal
this.c = endVal - beginVal
this.d = duration
this.result = {val:0,flag:false};
this.Execute = function () {
this.result.val = eval(this.pennerFunc)(this.t, this.b, this.c, this.d)
this.result.flag = (this.t >= this.d)
this.t++;
return this.result
}
}
// pennerFunc values are relative to an objects target property
function PennerREL (pfunc, obj, prop, relVal, duration) {
this.pennerFunc = pfunc
this.t = 0
this.b = obj[prop]
this.c = relVal
this.d = duration
this.result = {val:0,flag:false};
this.Execute = function () {
this.result.val = eval(this.pennerFunc)(this.t, this.b, this.c, this.d)
this.result.flag = (this.t >= this.d)
this.t++;
return this.result
}
}

fred = new Object(); fred._x = 100;

foo = new PennerABS ("Math.linearTween", 0, 10, 10);
boo = new PennerREL ("Math.easeInQuad", fred,"_x", -10,10)

do { res = boo.Execute()
trace(res.val + ":" + res.flag) }
while (!boo.result.flag);

do { res = foo.Execute()
trace(res.val + ":" + res.flag) }
while (!foo.result.flag);

How Do I Get The Volume Slider To Start At 50% Volume Instead Of 100% Volume?
I have code that sets the volume for the audio clips that I have loaded:

onClipEvent(load)
{
_root.soundstatus="on";
_root.mySound = new Sound(_level0);
_root.mySound2 = new Sound(_level1);
_root.mySound3 = new Sound(_level2);
_root.mySound4 = new Sound(_level3);
_root.mySound5 = new Sound(_level4);
_root.maxvolume=100;
_root.minvolume=0;
}

onClipEvent(enterFrame)
{
//if(_root.soundstatus=="on") {step=5}
//if(_root.soundstatus=="off") {step=-5}

//_root.maxvolume+=step;

if (_root.maxvolume>100) {_root.maxvolume=100;}
if (_root.maxvolume<0) {_root.maxvolume=0;}

_root.mySound.setVolume(_root.maxvolume);
_root.mySound2.setVolume(_root.maxvolume);
_root.mySound3.setVolume(_root.maxvolume);
_root.mySound4.setVolume(_root.maxvolume);
_root.mySound5.setVolume(_root.maxvolume);
}

I then setup a slider bar to adjust the volume:

onClipEvent (enterFrame) {
_root.maxvolume=this._x
trace(this._x)
}

Then I set the volume based on the dragging of the slider bar:

on (press) {
if(_root.soundstatus <> "off"){
startDrag(this, false, 1, 0, 100, 0)}
}
on (release) {
if(_root.soundstatus <> "off"){
stopDrag()}
}
The issue is that I cannot start the audio volume and slider at 50% of volume instead of 100%. Can someone please look at this code and help me understand how I can load this script so the slider volume starts at 50% not 100%? Thank you.

How Do I Get The Volume Slider To Start At 50% Volume Instead Of 100% Volume?
I have code that sets the volume for the audio clips that I have loaded:

onClipEvent(load)
{
_root.soundstatus="on";
_root.mySound = new Sound(_level0);
_root.mySound2 = new Sound(_level1);
_root.mySound3 = new Sound(_level2);
_root.mySound4 = new Sound(_level3);
_root.mySound5 = new Sound(_level4);
_root.maxvolume=100;
_root.minvolume=0;
}

onClipEvent(enterFrame)
{
//if(_root.soundstatus=="on") {step=5}
//if(_root.soundstatus=="off") {step=-5}

//_root.maxvolume+=step;

if (_root.maxvolume>100) {_root.maxvolume=100;}
if (_root.maxvolume<0) {_root.maxvolume=0;}

_root.mySound.setVolume(_root.maxvolume);
_root.mySound2.setVolume(_root.maxvolume);
_root.mySound3.setVolume(_root.maxvolume);
_root.mySound4.setVolume(_root.maxvolume);
_root.mySound5.setVolume(_root.maxvolume);
}

I then setup a slider bar to adjust the volume:

onClipEvent (enterFrame) {
_root.maxvolume=this._x
trace(this._x)
}

Then I set the volume based on the dragging of the slider bar:

on (press) {
if(_root.soundstatus <> "off"){
startDrag(this, false, 1, 0, 100, 0)}
}
on (release) {
if(_root.soundstatus <> "off"){
stopDrag()}
}
The issue is that I cannot start the audio volume and slider at 50% of volume instead of 100%. Can someone please look at this code and help me understand how I can load this script so the slider volume starts at 50% not 100%? Thank you.

Wrapper Swf That Pre-loads Sounds
Hi there, first post on flashkit hopefully many more to follow.

I am trying to make a wrapper swf file that preloads the main swf. I have managed to do this using the following code:

var myLoader:Loader = new Loader();

myLoader.contentLoaderInfo.addEventListener(Progre ssEvent.PROGRESS,showProgress);
myLoader.contentLoaderInfo.addEventListener(Event. COMPLETE,showLoadResult);
myLoader.load(new URLRequest("Mainpage.swf"));
addChild(myLoader)
function showProgress(evt:ProgressEvent):void {
percent.text = (100*evt.bytesLoaded/evt.bytesTotal)+"%";
}
function showLoadResult(evt:Event):void {
removeChild(percent);
removeChild(loading);
addChild(myLoader);
}


However I can't figure out how to also preload two mp3's that are used in the main SWF but still include this preloading in the wrapper as a part of the total % loaded. Is there a way of passing the loaded sounds from the wrapper to the main SWF or is there another way??

Thanks for your help, MonkEE

[F8] Trouble Loading SWF Into MC Wrapper
I am having trouble loading SWF into a MC wrapper. I am pretty new to flash so hopefully someone can pick this off quickly, I thought this was working until I put it together now I am having these strange problems.

it works fine when I pull it up directly, I can resize the windows and it reacts like I want:
http://www.rakbiz.com/pics/pb/photos/photos.swf?1=1


but when I load it into a wrapper, its comes up blank (click the top right button:
http://www.rakbiz.com/pics/


I am using moviecliploader and LoadClip to load the clip from the wrapper and its working fine for others .swf's that dont do any resizing.

Here is the code from the loaded clip that is choking:

Code:
import mx.controls.TextInput;
import mx.data.types.Int;
import mx.utils.XMLString;

var thumbWidth = 100;
var thumbHeight = 100;
var thumbBorderY = 25;
var thumbSegments = 0; //divided by the number if nodes ro children in xml

var MCL:MovieClipLoader = new MovieClipLoader();
MCL.addListener(this);


//
// FUNCTIONS
//
function thumbBlock() {
return (Stage.width / 4);
}

function thumbOffsetX() {
return (thumbBlock() - thumbWidth) / 2;
}

function loadPictureIntoMc(inClip:String, inX:Number, inY:Number, inFile:String) { //create our movieclip loader and load image

// Creates a movie clip to hold the container.
this.createEmptyMovieClip(inClip, this.getNextHighestDepth());

with (this[inClip]) {
_x = inX;
_y = inY;
}

// Loads an image into _mc.
var imgPath:String;
if (this == _level0) {
imgPath = "";
}
else {
imgPath = "pb/photos/";
}
MCL.loadClip(imgPath + inFile, this[inClip]);
}

function onLoadInit(inClip:MovieClip) { //event handler run after the MCL loader is complete
trace("onloadinint:")
if (inClip._name == "big_mc") {
trace("onloadinint:BIG")
with (inClip) {
_width = Stage.width - (thumbOffsetX() * 2);
_height = Stage.height - (thumbBorderY * 3) - thumbHeight;
}
} else {
with (inClip) {
_height = thumbHeight;
_width = thumbWidth;
}
buttonInit(inClip);
}
}


//
// BUTTONS
//
function buttonInit(inClip:MovieClip) {
inClip.onPress = function() {
MCL.loadClip(inFile,buf_mc);
}
inClip.onRollOver = function() {
with (inClip) {
_xscale += 10;
_yscale += 10;
}
}
inClip.onRollOut = function() {
with (inClip) {
_xscale -= 10;
_yscale -= 10;
}
}
}


//
//STAGE
//
function stageInit() {
Stage.align = "TL";
Stage.scaleMode = "noScale";

//setup stage resize listener
var stuff = new Object(); // create a custom object to register with the Stage object
stuff.onResize = function() { // add an 'onResize' method to our custom object.
stageResize();
}
Stage.addListener(stuff); // register our custom object with the Stage object.
}
function stageResize() {
// the function that actually does the stretching..
trace("Stage W:"+Stage.width+", H:" + Stage.height);

//trace("stageResize()");
//with (thumb1_mc) {
//_x = 25;
//_y = 25;
//_width = 200;
//_height = 200;
// }

//rearrange thumbs
for(var i:Number = 1; i<=4; i++) {
this["thumb"+i+"_mc"]._x = (thumbBlock()*i) - thumbBlock() + thumbOffsetX();
}

//rearrange big
with (big_mc) {
_x = thumbOffsetX();
_width = Stage.width - (thumbOffsetX() * 2);
_height = Stage.height - (thumbBorderY * 3) - thumbHeight;
}
}

//
// MAIN
//


stageInit(); //setup the stage and resize listener

loadPictureIntoMc("thumb1_mc", (thumbBlock() * 0) + thumbOffsetX(), thumbBorderY, "1.jpg");
loadPictureIntoMc("thumb2_mc", (thumbBlock() * 1) + thumbOffsetX(), thumbBorderY, "2.jpg");
loadPictureIntoMc("thumb3_mc", (thumbBlock() * 2) + thumbOffsetX(), thumbBorderY, "3.jpg");
loadPictureIntoMc("thumb4_mc", (thumbBlock() * 3) + thumbOffsetX(), thumbBorderY, "4.jpg");

loadPictureIntoMc("big_mc", thumbOffsetX(), (thumbBorderY*2) + thumbHeight, "1big.jpg");



trace("


Photos.this:"+this);
stop();

Thanks for your help!

GBY,
-R

Writing A Wrapper Class In AS
So I'm relatively new to AS and am running into some trouble. I'm trying to put together a wrapper class that will simplify use of an existing charting package I have access to.

As a first step, I am trying to write a class that will apply the supplied example to an empty movie. Here is what the original AS looks like:


ActionScript Code:
#include "../classes/com/fusioncharts/includes/LoadingFunctions.as"
#include "../classes/com/fusioncharts/includes/AppMessages.as"

import com.fusioncharts.core.charts.MSLine2DChart;

var strXML:String = "[[ some random XML here ]]";

var xmlData:XML = new XML(strXML);
var chartContainerMC:MovieClip = this.createEmptyMovieClip("ChartHolder",1);
var myFirstChart:MSLine2DChart = new MSLine2DChart(chartContainerMC, 1, 450, 360, 130, 20, false, "EN", "noScale");
myFirstChart.setXMLData(xmlData);
myFirstChart.render();
stop();

What do I need to watch out for when attempting to move this code into a self-contained class? I imagine "this.createEmptyMovieClip("...") will not work, what would I use to reference the movie rather than "this"?

Hopefully what I'm asking makes sense!

Very Odd Issue With As2 Swf In As3 Wrapper, Looking For Information
Sup er'body. So heres my issue, using loader and gskinners swf bridge, i have a as3 wrapper thats just used for functions and getting to the file system (thanks to air). The AS2 swf we bring it using loader, and just addChild(as2) to the stage of our as3 app. This app basically is a image viewer, that you can interact with using mouse or touchscreen. So there is just a review image and some rows of thumbnails.

Everything works cool and such except that sometimes movieclips disappear.

Only using the as2 version there seems to be no issue at all, i can't break it and make the images not appear.

But once I include it in the as3 wrapper and run it that way. Jumping around the thumbnail review panel after a few jumps no image appears where it should be. Just like the object isn't there. Also including it in the as3 wrapper makes the whole app run a bit more sluggish. If I increase the system priority for the app it performs better as well as the issue of images not appearing occurs a bit less. Looking at log files and traces nothing occurs out of the ordinary, so its working just like it should, but sometimes the objects just aren't there.

Now I have heard of issues between as2 and as3 of some componets not working right and stuff of that sort. I was mainly just wondering if people could let me know any issues people have seen occur when loading as2 swfs into as3. Thanks a lot guys.

Preloader Wrapper And Variables
I'm using a separate swf (preloader.swf) file to preload another swf (nav.swf) that has a tree component. Everything works fine except for a variable that nav.swf needs to access. The variable is coming in via SWFObject. If I replace the preloader.swf in the SWFObject with nav.swf then I can access the variable no problem. Question is how do I use preloader.swf and still access the navid variable?







Attach Code

<div id="flash_navigation">
<script type="text/javascript">
var so = new SWFObject("/preloader.swf", "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", "142", "500", "9", "#f3f3ec");
so.addVariable("navid", "21");
so.write("flash_navigation");
</script>
</div>

Question On MovieClip Wrapper
Hi there,

Just a quick newbie question ...I read the course outline of Macromedia on Flash Basic and under building a Navigational sys there was a sub-category on "Using a MovieClip as a wrapper".

What does it mean when you make a movieClip as a wrapper? does it mean movieclip buttons? Just confused on that part. I tried to check out some books but have failed to find the exact "term/wording" that refers to movieclip as a wrapper.

Thanks guys and have a nice day everyone!

Question On MovieClip Wrapper
Hi there,

Just a quick newbie question ...I read the course outline of Macromedia on Flash Basic and under building a Navigational sys there was a sub-category on "Using a MovieClip as a wrapper".

What does it mean when you make a movieClip as a wrapper? does it mean movieclip buttons? Just confused on that part. I tried to check out some books but have failed to find the exact "term/wording" that refers to movieclip as a wrapper.

Thanks guys and have a nice day everyone!

[F8] Trouble Loading SWF Into MC Wrapper
I am having trouble loading SWF into a MC wrapper. I am pretty new to flash so hopefully someone can pick this off quickly, I thought this was working until I put it together now I am having these strange problems.

it works fine when I pull it up directly, I can resize the windows and it reacts like I want:
http://www.rakbiz.com/pics/pb/photos/photos.swf?1=1


but when I load it into a wrapper, its comes up blank (click the top right button:
http://www.rakbiz.com/pics/


I am using moviecliploader and LoadClip to load the clip from the wrapper and its working fine for others .swf's that dont do any resizing.

Here is the code from the loaded clip that is choking:

ActionScript Code:
import mx.controls.TextInput;
import mx.data.types.Int;
import mx.utils.XMLString;
 
var thumbWidth = 100;
var thumbHeight = 100;
var thumbBorderY = 25;
var thumbSegments = 0;  //divided by the number if nodes ro children in xml
 
var MCL:MovieClipLoader = new MovieClipLoader();
MCL.addListener(this);
 
 
//
// FUNCTIONS
//
    function thumbBlock() {
        return (Stage.width / 4);
    }
   
    function thumbOffsetX() {
        return (thumbBlock() - thumbWidth) / 2;
    }
 
    function loadPictureIntoMc(inClip:String, inX:Number, inY:Number, inFile:String) { //create our movieclip loader and load image
 
        // Creates a movie clip to hold the container.
        this.createEmptyMovieClip(inClip, this.getNextHighestDepth());
 
        with (this[inClip]) {
            _x = inX;
            _y = inY;
        }
 
        // Loads an image into _mc.
        var imgPath:String;
        if (this == _level0) {
            imgPath = "";
        }
        else {
            imgPath = "pb/photos/";
        }
        MCL.loadClip(imgPath + inFile, this[inClip]);
    }
   
    function onLoadInit(inClip:MovieClip) { //event handler run after the MCL loader is complete
        trace("onloadinint:")
        if (inClip._name == "big_mc") {
            trace("onloadinint:BIG")
            with (inClip) {
                _width = Stage.width - (thumbOffsetX() * 2);
                _height = Stage.height - (thumbBorderY * 3) - thumbHeight;
            }
        } else {
            with (inClip) {
                _height = thumbHeight;
                _width = thumbWidth;
            }
            buttonInit(inClip);
        }
    }
 
 
//
// BUTTONS
//
    function buttonInit(inClip:MovieClip) {
        inClip.onPress = function() {
            MCL.loadClip(inFile,buf_mc);
        }
        inClip.onRollOver = function() {
            with (inClip) {
                _xscale += 10;
                _yscale += 10;
            }
        }
        inClip.onRollOut = function() {
            with (inClip) {
                _xscale -= 10;
                _yscale -= 10;
            }
        }
    }
 
 
//
//STAGE
//
    function stageInit() {
        Stage.align = "TL";
        Stage.scaleMode = "noScale";
 
        //setup stage resize listener   
        var stuff = new Object(); // create a custom object to register with the Stage object
        stuff.onResize = function() { // add an 'onResize' method to our custom object.
            stageResize();
        }
        Stage.addListener(stuff);  // register our custom object with the Stage object.        
    }
    function stageResize() {
        // the function that actually does the stretching..
        trace("Stage W:"+Stage.width+", H:" + Stage.height);
       
        //trace("stageResize()");
        //with (thumb1_mc) {
            //_x = 25;
            //_y = 25;
            //_width = 200;
            //_height = 200;
        // }
 
        //rearrange thumbs
        for(var i:Number = 1; i<=4; i++) {
            this["thumb"+i+"_mc"]._x = (thumbBlock()*i) - thumbBlock() + thumbOffsetX();
        }
       
        //rearrange big
        with (big_mc) {
            _x = thumbOffsetX();
            _width = Stage.width - (thumbOffsetX() * 2);
            _height = Stage.height - (thumbBorderY * 3) - thumbHeight;
        }
    }
 
//
// MAIN
//
 
 
    stageInit();  //setup the stage and resize listener
 
    loadPictureIntoMc("thumb1_mc", (thumbBlock() * 0) + thumbOffsetX(), thumbBorderY, "1.jpg");
    loadPictureIntoMc("thumb2_mc", (thumbBlock() * 1) + thumbOffsetX(), thumbBorderY, "2.jpg");
    loadPictureIntoMc("thumb3_mc", (thumbBlock() * 2) + thumbOffsetX(), thumbBorderY, "3.jpg");
    loadPictureIntoMc("thumb4_mc", (thumbBlock() * 3) + thumbOffsetX(), thumbBorderY, "4.jpg");
   
    loadPictureIntoMc("big_mc", thumbOffsetX(), (thumbBorderY*2) + thumbHeight, "1big.jpg");
 
 
   
trace("


Photos.this:"+this);
    stop();




Thanks for your help!

GBY,
-R

Will An .swf Stream Outside Of An HTML Wrapper File?
perhaps this is a stupid question, but is it possible to launch an SWF in a separate window WITHOUT using a HTML wrapper file and have the SWF stream?

i don't mean embedding the SWF in a HTML wrapper file and then launching a new window calling that wrapper file. that will obviously work.

but i've noticed that whenever i simply launch the SWF itself...

example:
onClick = "window.open('myMovie.swf','MyMovie','width=820,he ight=441,status,scrollbars=no,resizable=yes')"

...my SWF will only begin playing after it has been completely downloaded. the SWF even has a preloader built into it, so the first couple of frames are only 2k in size, but the preloader is rendered useless because the first frame won't even begin playing until all frames have been loaded. the user ends up staring at a blank screen.

thanks.

Wrapper Movie Clip Question
Hi I have a question........I'd like to wrap every movie clip onstage in a "wrapper movie clip" so I can resize everything in one swoop......so I'm wondering what the path would be to my componets.....is _root.myclip.msg.text? or what?

Looking For Tips On Creating A Word Wrapper
Hi there,

I'm just beginning my studies in flash and I'd like to create a form that people could enter words in on the web, and then have them generated with quotes or brackets around them. For instance, you can type in

hat
car
pig

and the form would change them into:

"hat"
"car"
"pig"

I'm sure Flash is capable of this, and I know this site has a wealth of tutorials--but I don't know what to call this form, in order to search for it.

What kind of form would this be, and if you know of any tutorials in creating one, please send them my way.

Thanks for the tips, and I look forward to spending a lot of time here at such a neat resource.

aprylian

Still Working On Simple Wrapper Form
This is what I've come up with so far:

http://www.creatingconsciously.com/wrapper.fla

But even with the code suggested here, it's not working right--I must be doing something
wrong. Thanks for the help!

apryl

Application Wrapper And Access To Stage
Hi,

I have my application swf with its document class Application. I made a wrapper swf in order to preload the application, so the entire project has the following structure:

wrapper.swf -> Document class: TopLevel.as
main.swf -> Document class: Application.as

The problem is that I cannot access the stage when I publish the main.swf file, so it gives compiling errors.

Note: Application and other classes used in the project try to access the stage through static methods (i.e. Application.showPreload() ).

What am I doing wrong?

Creating YouTube Like Video Wrapper
here's what I want to do:

Create a video player much like Lee's that has the following characteristics:
- "frontpage" still that when clicked triggers the play event
- link to above still and video in embed code so that the same swf can be used to display numerous different jpg and flv files.
- no xml or other external file control. it has to be in the embed code to work in a blogging context.

The whole idea is to be able to embed a customized player in blogging software without having to use YouTube or similar services.

I think this can be done with flashVars or something like that but I'm sketchy on the details. If anyone has any ideas it would be a great help 'cause YouTube just won't do - I need more control.

mor10

Preloading Wrapper, Avoid Heavy 1st Frames
Here is a preloading tip, brought to you by JRMillion

As you probably know flash jams a lot of stuff into the first frame of your swf, library items linked for actionscript (unless you specify) and the first frame is also where AS classes are kept.

This can become a problem when you try to setup a preloader. If the first frame makes up the majority of the filesize your preloader wont work well.

Here is something I do to avoid this problem, and prevent me from having to include the preloader in the main site swf.

Create a second swf of the same size as your main one

and on frame one place this code


Code:
siteLoader = new MovieClipLoader();

//Called when swf data starts getting downloaded
siteLoader.onLoadStart = function(target_mc){
target_mc.stop();
}

//called over and over while data is downloading
siteLoader.onLoadProgress = function(target_mc, loadedBytes,totalBytes){
loader.text = Math.ceil((loadedBytes/totalBytes)*100) +'%';
}

//Called when first frame of loaded swf is run
siteLoader.onLoadInit = function(target_mc){

}

//Called when load is Complete, duh :)
siteLoader.onLoadComplete = function(target_mc){
loader._visible = false;
target_mc.play();
}
siteLoader.loadClip("main.swf",1);
stop();
What this does is act as a wrapper, whos only job is to preload your main swf, without having to deal with possible "heavy frames".
It loads your swf into a Level rather than a clip, so you wont run into possible scope and _root referencing issues as you would when loading into a clip.

This assumes you have a dynamic text box called "loader", which the script also hides once the loading is complete.

You could obviously modify this a little bit too work with "cooler" loaders, but I figured id keep the example simple.

How To Make A SWF Wrapper With A Clickable Transparent Button Overlay?
Hi all, I'm trying to figure out how to make a configurable wrapper or container file that I can simply pass variables such as

wrapper.swf?m=movie-to-load&u=url-that-button-goes-to

It seems simple enough, and I'm half way there ( I can get external movies to load ) however the transparent button is over my head ( read: I'm a complete noob ).

Currently I have a simple one frame movie with this actionscript in it:

_root.loadMovie(_root.m);

And a transparent button that fully envelops the stage with the following actionscript in it:

on( release ){
getURL(_root.u);
}

I've tried hardcoding a url into getURL as well but it doesnt' seem to be recognizing that there's even a button there.. is that because there's a new movie being loaded??

Any help would be greatly appreciated!

BTW I'm doing this with Flash 8 if that makes any difference.

[F8] FLV Playback/Custom UI Volume Components With Global Volume Control
I'm creating a multi-scene swf with several FLV Playback - Player 8 Component videos on different scenes/frames.

I want to use the FLV Playback Custom UI Volume Bar so that when a user makes a volume adjustment during one FLV Playback viewing that volume adjustment will remain throughout the other FLV Playback video viewings.
This will prevent the viewer from having to make volume adjustments for each viewing. However, I want to enable the volume change to be made and changed at any time throughout any of the video viewings. Another aspect of this is that the FLV Playback Component has a volume setting that would have to be overridden by the global custom UI volume setting.

Is this possible? If so, how would this be done?

Thanks!

James
jamesk@pacificmm.com

Volume Slider Tutorial (changing The Start Volume)
Hi,

This is my first post, also my first problem. Not going so well so far! Okay, i downloaded the tutorial and read through it. Maybe not so well, since i'm a little stuck.

I wanted to modify the slider, so rather than starting off as silent, it starts off so the sound can be heard. So i edited the slider and moved the indicator further along. However, the mp3 cannot be heard until the silder indicator is moved.

i tried modifying the play button to this;


ActionScript Code:
on (release) {    if (_root.mySlider.complete == 1) {        _root.mySlider.mySound.stop();         mySound.setVolume(_root.volume(ratio));        _root.mySlider.mySound.start(0, 99);    }}


but it still doesn't seem to work. Also the 'circles' don't automatically take the height. As soon as I move the slider, the circles 'jump' to the correct size and the volume plays properly.

Also i'd kind of like the song to start playing as soon as its loaded. Okay, i know that i could maybe download something that does all of this already, but i'd rather (or more likely be shown how to) modify the tutorial since i'm a beginner.

Apologies, i'm new to all this. I know some oop, but actionscript and all these properties are a bit new to me.

Thanks in advance,

Volume Buttons Change Volume More Than Once Per Click
I am going to try to explain this as best I can without posting the code for all 4 classes and the timeline.

Information:
I have a class that controls the playing of the sound, it also is hooked up to my volume up and down buttons. I have a class for a button that moves the frame forwards and another that moves the frame backwards. On the timeline I have a layer for sound, where I import the class that does the sound as well as instantiates it and add the child (which is a sound file). The class that plays the sound file also automatically goes to the next frame when the sound is done. Relevant code will be posted after explanation of problem.

Problem:
When the next or back buttons are clicked, flash moves to the next or previous frame, which then does addChild and instantiates the class for sound again. I do have each frame set to SoundMixer.stopAll(); which does stop the sound but it doesn't prevent multiple instances of the class or child being active. So what happens then is that if I hit the next button 5 times, then click the sound up button, the sound goes up 6 times! at once.

Relevant Code:
relevant portions of class that controls sound:

Code:
public static var trans:SoundTransform = new SoundTransform();

Code:
private function soundUp(event:MouseEvent)
{
SoundMain.trans.volume += .2;
trace(SoundMain.trans.volume);
soundChannel.soundTransform = SoundMain.trans;
}
relevant portions of timeline code (on each frame):

Code:
import flash.media.SoundMixer;
SoundMixer.stopAll();

import lesson.SoundMain;
var sndEx2:SoundMain = new SoundMain("micRec2.mp3");
addChild(sndEx2);
partial code in next button class:

Code:
private function oneFrameForward(evt:MouseEvent):void
{
MovieClip(parent).nextFrame();
}
I appreciate any help.

Drag MC And Volume - How To Translate Into Volume 0-100?
Hey there

I am building a room in which you can drag a MC in order to controll pan and volume. I am using:

function drag() {
kasse1Pan.kasse1.startDrag(false, -400, -300, 400, 300);
kasse1Pan.kasse1.onEnterFrame = function() {
pan = 0.25*this._x;
vol = 300+this._y;
kasse1Sound.setPan(pan);
kasse1Sound.setVolume(vol);
};

The problem is that the stage is 800 x 600, and therefore -300 is translated to zero (when the MC is at the top of the stage) and 300 is translated to 600 (when the MC is at the bottom of the stage). Naturally, this causes the volume to distort.

I need find a way to translate the -300 and 300 to 0 and 100% volume.

Can you help? Oh, I hope so...

/Donleavy

Volume Knob And Volume Display
I am creating a mp3 player. I have a functional volume knob. I want it to control a movieclip which shows the status of the volume when the knob is rotated.

Volume - Setting Initial Volume
In addition to code help with setting the initial volume, can anyone tell me why the slider might be staying at the end of the bar once I'm off dragging it.. It doesn't move back to the start of the slider when I drag to increase volume the first time...

This is where the fla file is in case anyone wishes to help me with the latter question...

http://www.clairmonthumphrey.com/Site/humphreytemplate.fla

Thanks so much!







Attach Code

//volume slider
dragger.onPress = function()
{
this.startDrag(true, dragger._x, dragger._y, dragger._x + 95, dragger._y);
};
dragger.onRelease = dragger.onReleaseOutside=function ()
{
stopDrag();
};

dragger.onMouseMove = function()
{
newPoint = new Object();
newPoint.x = this._x
newPoint.y = this._y
_root.slidebar.globalToLocal(newPoint);
_root.s.setVolume(-1*newPoint.x);
}

Volume Slider Bar Innital Volume
I need a simple solution for my volume slider bar problem, I completed the volume slider bar tut. on kirupa and it works for what i'm doing, but i'd like the volume to default to 70 or 80 instead of 0, so that the music plays when the movie starts. I'm sure this is a simple line of code that i'm overlooking, any help would be appreciated.

Thanks!
scott.dixon@itron.com

Volume Slider Bar Innital Volume
I need a simple solution for my volume slider bar problem, I completed the volume slider bar tut. on kirupa and it works for what i'm doing, but i'd like the volume to default to 70 or 80 instead of 0, so that the music plays when the movie starts. I'm sure this is a simple line of code that i'm overlooking, any help would be appreciated.

Thanks!
scott.dixon@itron.com

Controlling Timeline Of "wrapper" Movies With Internal Movie Frames?
Hey,

I've constructed what I hoped would be a functioning slideshow, only I'm stuck with it displaying only the firts picture.

I've got the following setup:

The slideshow appearing on a page, it is a movieclip called "slideShow_mc"

Inside this clip is a series of movie clips, each set on their own frame. Each clip has a name like "slide1_mc," "slide2_mc" and so on.

Each slide is itself a movie with a 15 frame timeline, with an alpha channel motion tween so that the images fade from frame one to frame 15, all purty like. So, in all it goes three layers deep.

Now, on the last frame of each slide, I've got a "stop();" action, so that they won't loop -- however, this also means that only the first image loads, and I can't get the playhead to advance to the next slide :/

I've tried placing this on the same frame as the stop action:

slideShow_mc.gotoAndPlay(2);

...but it doesn't work.

I've tried:

slideShow_mc.gotoAndPlay(slide2_mc);

and

_parent.gotoAndPlay(2);

and

_parent.Play();,

and even

nextScene();

All without any luck.

I've got my copiues of the FlashMX 2004 Bible and the O'Reilly's AS book open, but I can't seem to find what I don't know I'm looking for

Please help...thanks!

- jim

.SWF "wrapper" To Prevent Bandwidth Theft?
Greetings

In response to my original post (below in blue, from another forum) a helpful respondent mentioned the following:
Create a simple .swf wrapper that pulls in your ovoid.swf if it's being run from your server, otherwise displays a "You're viewing stolen content" message. I know I was a little sketchy on details but I'm not a Flash guy. I do know Flash guys and have heard them talking about this very subject and that kind of solution so I know it's possible.

Can anyone here offer some insight as to how I might do this? (See original post below for context)

Thanks,

--IAW

I've got a bozo who's stealing bandwidth by embedding an .SWF file from my site in a page in his site.

I tried denying just his site access using <Limit GET> in duplicate .htaccess files in the root and in my /images/ directory (yes, there are index.html files in each directory), but couldn't get it to work. For his thievery, he's using:

<EMBED src="http://www.astonishedhead.com/images/OVOID.swf" WIDTH=700 HEIGHT=500></EMBED>


So, I decided to shut off hotlinking for image and Flash files entirely, and refer incoming traffic to another file.

In my .htaccess files, I used:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?astonishedhead.com(/)?.*$ [NC]
RewriteRule .*.(gif|jpg|jpeg|bmp|swf)$ http://www.astonishedhead.com/why.html [R,NC]

I have found that all external links to these file types are now properly referred to why.html.

However: on the offending site's page, my embedded content is blocked when using Mozilla...but not when using MSIE!

My ideal solution would be to block only that one particular site's embedded use of my content...but, failing that, I'll settle for a solution that effectively blocks the files types for all referrers and all browsers, and sends them to the alternate file.

Any insight would be appreciated!

Copyright © 2005-08 www.BigResource.com, All rights reserved