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








XML Help Placing Files In Appropriate Holder


I'm trying to swap depths when my endtime is hit. I need help on a function or the process that would allow me to place different files in the appropriate holder once the endtime is hit on the timeline.

Once the endtime is hit,
check the the mediatype,
then determine which holder the next file(.jpg, .swf, .txt) should be placed.

<xml>
<count id="1">
<mediatype>1</mediatype>
<information>adsfasdfasfdasdfas</information>
<endtime>12</endtime>
</count>
<count id="2">
<mediatype>2</mediatype>
<information>627849554.zip</information>
<endtime>50</endtime>
</count>
<count id="3">
<mediatype>3</mediatype>
<information>2052325590.swf</information>
<endtime>150</endtime>
</count>
</xml>

Here's my as:
<as>

if(xml.firstChild.childNodes[n].childNodes[x].nodeName=="count")
{
trace(xml.firstChild.childNodes[n].childNodes[x].nodeName + " = " + xml.firstChild.childNodes[n].childNodes[x].attributes[attr]);
for(var l=0;l<xml.firstChild.childNodes[n].childNodes[x].childNodes.length;l++)
{
trace(xml.firstChild.childNodes[n].childNodes[x].childNodes[l].nodeName +" = "+ xml.firstChild.childNodes[n].childNodes[x].childNodes[l].firstChild);
}
trace("");
}

</as>

Output:

count = 1
mediatype = 1
information = adsfasdfasfdasdfas
endtime = 12

count = 2
mediatype = 2
information = 627849554.zip
endtime = 50

count = 3
mediatype = 3
information = 2052325590.swf
endtime = 150

much grats,
chris




FlashKit > Flash Help > Flash ActionScript
Posted on: 07-24-2003, 04:19 PM


View Complete Forum Thread with Replies

Sponsored Links:

Placing Different XML Files With With Appropriate Holder?
Anyone,

I'm trying to swap files when my endtime is hit. I need help on a function or the process that would allow me to place different files in the appropriate holder once the endtime is hit on the timeline.

Once the endtime is hit,
check the the mediatype,
then determine which holder the next file(.jpg, .swf, .txt) should be placed.
endtimerepresents time in seconds. A user will type in how long he/she wants to display a certain file(.txt, .jpg, etc.). I will convert that to frames. Then, once that file time expires the next file needs to be placed in the correct holder.

e.g.
I have 2 files, the 1st being text the 2nd is jpeg.
The text will be entered in a dynamic text box for 12s.
The jpeg file will follow once the 12s(endtime) has been hit.
Now, I need to hide the dynamic text box and make the jpeg holder visible.

Much grats in advance!!

C

View Replies !    View Related
Placing Empty MC In A Holder.
Hey,

I'm working on the Kirupa photo gallery and that works fine. Now I want to change how the thumbnails are loaded in. I would like them to be loaded in a holder (now in an emptyMC) so that I can put a mask/ border on it.


This is the thumbnail function:


Code:
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k,thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {

target_mc._x = hit_left._x+(eval("thumbnail_mc.t"+k)._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};

target_mc.onRollOver = function() {
this.colorTo(0xf8ee08,1,"easeOutQuint");
thumbNailScroller();
};

target_mc.onRollOut = function() {
this.colorTo(normal, 1,"easeOutQuint");
};

};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k],"thumbnail_mc.t"+k);
}
Any ideas how i can do this?

Thanks!
Will

View Replies !    View Related
Using A Place Holder To Load Outside Files
Okay I have a new all flash site coming out soon, and i wanted to know if anyone has a way to create a place holder, that will call out on the database to load a certain swf file. Basically i have this main index and at the bottom i want a separate swf file (radio bar)
to be preloaded and finally loaded into the main movie clip scene. I just want to know how to do this, I haven't really seen anything like this in the tutorials, so any help is appreciated, thanks

Simp

View Replies !    View Related
Placing Imported SWF Files
I got a project for school do tommorow. Im importing swf files into my project. So far it has two parts a menu system at top, and a main intro.

When i import in the intro it is place onto of the menu system, how do i put it in the location i want? Im sure there is some simple explanation, but i have been having trouble finding it.

thanks,
Jim Miesner

View Replies !    View Related
Actionscript Placing Movie Clip And Manual Placing Movie Clip OnPress Blues
Hi,

I placed a movieclip onto the stage and wrote an onPress function for it and it worked fine.

I then deleted it off the stage, and then instead tried using actionscript to attach movie clip onto the stage and set its x,y coordinated.

It showed up on the stage in the right place but didn't respond to clicks (presses) on it.

I used:
this._parent.attachMovie("up_arrow", "upArrow", 1);

The name of the mc in the library is "up_arrow", and I made sure it was exported for actionscript too.

this._parent.upArrow.onPress = function() {
trace("up button pressed");
};

This onPress function only works if I manually place the mc on the stage in the editor and not when I use actionscript.

I don't know why it's not working, anyone have any ideas? You're help is appreciated.

Many thanks.

Akira

View Replies !    View Related
MC Holder ? Sorry Im New
please help...am trying to add barneys style menu which I have working perfect on its own. But as soon as i try and put it into a site im creating it just does not work. I am using this as a photo slide show..by the way


I have read on another post that it must be place into a MC holder...aaargh wats this??? please help new here!!! thanks in advance u technical peeeps

View Replies !    View Related
What Is A MC Holder?
hey guys, can you tell me what is the meaning of a MC Holder?

thanks for your help.

View Replies !    View Related
Place Holder
I've made a main movie and I wish to open another movie into it when a button is clicked on. I want the 2nd movie to open in a certain spot. How do I accomplish this? I can't attach the file, it's too big.

View Replies !    View Related
LoadMovie Holder
Hi guys!

Got another question and this time it might sound newb but o well bare with me

Ok...i want to load a movie into a frame which I made a movie. What i mean is not load the movie in the frame at the X=0 Y=0 location but in the movie itself!

I tried levels but i guess thats not it so HELP!

View Replies !    View Related
Duplicate Holder
Hi there,

If I would load in different extern.swf using the same holder in my main swf.
what does the duplicate holder do to your scripting.

I see a lot off people using this dupl.function.Does this make it possible when loading cont0.swf the other extern.swf are loaded but we can't see it.It's faster loading?

Can someone explain by a sample script what this function has up in it's sleaves.

Grtz,

View Replies !    View Related
Image Holder
can anyone recommend a good tutorial on loading an image into a movie clip. basic is better.

View Replies !    View Related
Mc On Top Of External Swf's(holder)
Hi there,

I'm looking for a way to do the following.When the visiter is over the nav system a frame made inside an mc(box alpha 40%)chalks the website.

From my main swf all content is loaded external into a holder(so no levels).
Is there a way to have an mc that I can make visibele when rollover the nav.system and is on top off the loaded external swf's or is there another way to do this.Any sugestions?

ok but there is one other prob. the nav I don't won't to be chalked.Because the nav changes in position each time I hit one off the buttons.So the mc should not be visible in the area off the nav.The nav is an mc placed on the scene off the main swf.

Hope there is a solution to this.Hope to get you back on this

Grtz,

View Replies !    View Related
GetURL In MC Holder?
Is there any way to load a URL into a movieclip just as you would do with loadMovie?

Thanks,
Jason

Flash MX 2004 Pro

View Replies !    View Related
Target Holder
hey everyone. Is there a way to target a MC container in one swf from another external one?

View Replies !    View Related
Holder Problems
This might be an easily fix, I might have been looking at the code too long.
I'm loading a swf into a movie clip instance with the following code:

loadMovie("vids/mymovie.swf", holder);

The movie that is being loaded in is a video with controls, play, pause, volume, etc. When I play the movie and the video loads in all the controls work with the exception of the volume. However if I open the swf alone the volume controls work. I thought the loaded movie assumes the properties of the Movie Clip instance it is loaded into.

Below is the code I have on the volume control. Do I have to change anything in here?


onClipEvent (load) {
_root.volumeLevel = 100;
left = _x-50;
right = _x;
top = _y;
bottom = _y;
}

onClipEvent (enterFrame) {
if (dragging) {
_root.volumeAmount = ((_x-left)*2);
_root.volumeLevel = Math.round(_root.volumeAmount);
_root.mySound.setVolume ((_x-left)*2);
if (_root.volumeLevel > 1){
_root.offonText = "sound on";
}
else if (_root.volumeLevel < 1){
_root.offonText = "sound off";
}
}

}



thanking you in advance

View Replies !    View Related
Targeting Swf Holder Mc
Hi,
In my site I have my sections loading in to a holding mc that sits on the root time line. One of the sections shows dress collections so I have approx 20 btns that then need to load in the dresses as individual swf's into the holding mc. How can I target this mc?

View Replies !    View Related
How To Preload Holder MC
HI, I`m trying to use this code to preload holder MC which is loading external SWF, but it looks like I`m not doing all the things right.

byteload = _root.holder.getBytesLoaded();
bytetotal = _root.holder.getBytesTotal();

ready = Math.round((byteload/bytetotal)*100)+ "%";
ready1 = Math.round((byteload/bytetotal)*100);
kilobytes = Math.round(bytetotal/1000);
bar._xscale = ready;
if (ready1 == 100) {
this.gotoAndStop (3);
_root.play();
}else{
gotoAndPlay (1);
}

please help

View Replies !    View Related
Holder Problems
ok when i click on the button i have it loading another movie using a holder. but when i export it its not showing up.

i can email the movie to anyone who can help.

here the action script i have right now

on(release) {
if(_root.window_mc._currentframe==5)
_root.window_mc.holder_mc.load("home_content.swf") ;
else{
_root.window_mc.whatToLoad="home.swf";
_root.window_mc.play();
_root.currentselection.enabled=true;//to enable the old btn
_root.currentselection=this;
this.enabled=false;//disable this one coz it's selcted
}
this.holder_mc.loadMovie(this.whatToLoad);

}

View Replies !    View Related
Datatyping An MC Holder
This is probably an embarassingly basic question, but here goes:

if I st up a var to contain MC's, how should it be datatyped? I've been using

var mcHolder:Object

but I'm wondering if thats the proper choice. I'll use it like so later:

function doSomething(mc){
_root.mcHolder = mc;
//other stuff
}


//some time later...

_root.mcHolder._visible = false;

Should I be using :Object? Does it matter?

thx,

-Z

View Replies !    View Related
Mc Holder Problem
When I try loading a movie into a holder this is the script that I used.

.....

loadMovie ("ex01.swf", "holder01");

..the problem is that the file will not come up in the center of the MC it come to the lowerleft corner of the position the holder is in?

Why what can I do about it?

View Replies !    View Related
_root.holder Help
hi their,
im not v.good at actionscripting but i have a movie that has dragable windows and i currently have them unload when a new one is opened.

ActionScript Code:
on (release) {
    unloadMovie("_root.holder");
    loadMovie("../_movies/mymovie2.swf", "_root.holder");
}
i can remove the "unloadMovie("_root.holder");"
BUT
what do i need to do to the ""_root.holder");" to get it to load keeping the old one still open??
e.g "_root.holder2" ????
Please help i dont understand how to create or add another _root.holder layer?
Adam

View Replies !    View Related
Getting To Holder In A LoadVars
I'm trying to get to the holder (textBox) from a LoadVars object. I need to set a property in that holder from the myLoadVars.onLoad function:


ActionScript Code:
#initclip

function textBox () {
        // Some code
    this.createTextField("myText", 0, myx, myy, mywidth, myheight);
    this.loader = new LoadVars();
    this.loader.onLoad = function (success) {
        trace(this.string);
                //I want to set myText.text to loader.string
                //I know loader.string is set correctly, I just can't
                //Get to myText from here
    };
        // More core
}

#endinitclip

Is there a better way to do this? Either way, is there a way to get to myText from here?

View Replies !    View Related
Trace Holder?
Is there a way to trace what is loading into a holder? and the feedback? I only get to see error opening URL but I can't do enything with it. I have a lot of thumbs made out of movieclips and some images are missing on purpose for those thumbs.
What I want to do is when a image is missing a script tells the movieclip HIDE. I already try for this.getBytesTotal = -1 but on externel movieclips it has no effect. Can anyone give me advice how to fix this problem?

View Replies !    View Related
Problems With MCL Holder
Hello
I hope I can express at the best my 2 problems because it is not so simple:

1) I have created a Flash site where buttons import, inside Holder Movieclips, an external swf.
the code is:

var mcl:MovieClipLoader = new MovieClipLoader ();
var mclL:Object = new Object ();

mclL.onLoadProgress = function (target,loaded,total) {
loader.percent.text = Math.round ((loaded/total) * 100) +"%";
}

mclL.onLoadInit = function () {
loader._visible = false;
loader.percent.text ="";

}

mcl.addListener(mclL)

mcl.loadClip("minimovie_creativ.swf", holder1);

cr3ativo.onRelease = function () {
loader._visible = true
mcl.loadClip("minimovie_creativ.swf", holder1);
}

fashion.onRelease = function () {
loader2._visible = true
mcl.loadClip("books.swf", holder3);

}

stop();

this work fine but when the site it is being open for the first time the swf starts play without being triggered by the button, after that everything works. All the keyframes (button, action, button) are in the same position so I though that if I move the Holder Keyframe forward it would work but, when played, nothing happen and when I take it right back it begins to work again. What do i have to do to??

"2) I would like to add another Holder MovieClip controlled by another set of Actions but Flash plays them all together. I have figured that if I solve the problem number 1 maybe this one will be solve as well.
thank you so so much this forum it is very helpful

View Replies !    View Related
Video Holder
I am trying to embed (on click) an .swf video inside an empty movie clip I am using as a "holder". Im trying to figure out how to call the .swf when a user clicks a button. I have used as2 before for something like this but i have no idea how to approach this with as3. Please help.

Thank you.

View Replies !    View Related
Image Holder
Does anyone know of a good tutorial, or advice to display jpg's in a loader with buttons below that would load different pictures on click? It would display a portfolio of artwork and when people clicked buttons they could view different images ect...
Anything will help thanks.

View Replies !    View Related
Xml Menu Within Holder Mc
Hi all,

how is everyone doing....
I`m trying to implement the attached horizontal XML menu into a site. If all the AS are on the _root timeline it works fine, but I need to insert the xml menu into the holder clip c_fd (_root.c_fd.{theRest}). I`ve tried to adjust all the existing path, but I also don`t know exactly which ones. Perhaps you guys have a solution for this.

Yeah, I also could load the whole navigation into a new level, but that won`t work with the stage listener.

Thx a bunch,
m.

View Replies !    View Related
Place Holder Help
I need a lil help with this script I have. Im making a resize-able box for my main interface and I have script to make the menu fallow the box while it resizes. This only thing is that it is hard to set the original position and how far to stay. Here is the script I have as of now.


ActionScript Code:
onClipEvent (enterFrame) {
    disMenWin = 5;
    _root.menu._Y = _root.window._Y+(_root.window._width/2)+disMenWin;
    _root.menu._X = _root.window._X+(_root.window._width/2)+disMenWin;
}


Can some one help me improve this script? Thanks in advance.

View Replies !    View Related
Holder Keeps Jumping
Hello,

I used the Carousel III tutorial to make a linear gallery with a holder, which shows larger images of the icons. I tried everything, but I can't get my holder to stay centered... whether I stick one directly on the stage or use the attachMovie method, both ways is won't stay centered. When I put it in the xcenter of my stage, it jumps like 100px down and 100px right.. I think it might have something to do with the Tweens.. (the code needs some cleaning up..I know)

can anyone help me?

Code:

import mx.utils.Delegate;
import mx.transitions.Tween;
import mx.transitions.easing.*;

var numOfItems:Number;
var radiusX:Number = 600;
var radiusY:Number = 20;
var centerX:Number = (Stage.width / 2)-100;
var centerY:Number = (Stage.height-20);
var speed:Number = 0.05;
var perspective:Number = 180;
var home:MovieClip = this;
//var holder:MovieClip = this.attachMovie("holder","holder",1000)
//holder._x = (Stage.width / 2) - 217;
//holder._y = centerY-550;

theText._alpha = 0;
holder._alpha = 0;
loadtekst._alpha = 0
var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
tooltip._alpha = 0;

var xml:XML = new XML();
xml.ignoreWhite = true;

xml.onLoad = function()
{
   var nodes = this.firstChild.childNodes;
   numOfItems = nodes.length;
   for(var i=0;i<numOfItems;i++)
   {
      var t = home.attachMovie("item","item"+i,i+1);
      t.angle = i * ((Math.PI*2)/numOfItems);
      t.onEnterFrame = mover;
      t.toolText = nodes[i].attributes.tooltip;
      t.content = nodes[i].attributes.content;
      t.imageLarge = nodes[i].attributes.imageLarge;
      t.icon.inner.loadMovie(nodes[i].attributes.image);
      t.r.inner.loadMovie(nodes[i].attributes.image);
      t.icon.onRollOver = over;
      t.icon.onRollOut = out;
      t.icon.onRelease = released;
   }
}

function over()
{
   //BONUS Section
   var sou:Sound = new Sound();
   sou.attachSound("sover");
   sou.start();
   if (this._parent>centerY) {
   home.tooltip._alpha = 100;
   home.tooltip.tipText.text = this._parent.toolText;
   home.tooltip._x = this._parent._x;
   home.tooltip._y = this._parent._y + 10;
   home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
      }
   else {home.tooltip._alpha = 0
   home.tooltip.tipText.text = this._parent.toolText;
   home.tooltip._x = this._parent._x;
   home.tooltip._y = this._parent._y + 10;
   home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
   }
   
}

function out()
{
   delete home.tooltip.onEnterFrame;
   home.tooltip._alpha = 0;
}

function released()
{
if (this._parent._y>centerY) {
   
   //BONUS Section
   var sou:Sound = new Sound();
   sou.attachSound("sdown");
   sou.start();
   
   home.tooltip._alpha = 0;
   for(var i=0;i<numOfItems;i++)
   {
      var t:MovieClip = home["item"+i];
      t.xPos = t._x;
      t.yPos = t._y;
      t.theScale = t._xscale;
   
      if(t != this._parent)
      {
         //var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
         //var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
         //var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,100,0,1,true);
      }
      else
      {
         //var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,100,1,true);
         //var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,true);
         //var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,200,1,true);
         //var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,320,1,true);
         loadtekst._alpha = 100
         var tw4:Tween = new Tween(t,"_alpha",Strong.easeIn,100,20,2,true);
         var tw5:Tween = new Tween(theText,"_alpha",Strong.easeOut,0,100,1,true);
         var tw5:Tween = new Tween(holder,"_alpha",Strong.easeOut,0,100,1,true);
         holder.loadMovie(t.imageLarge);
         theText.text = t.content;
         var s:Object = this;
         tw.onMotionStopped = function()
         {
            s.onRelease = unReleased;
         }
      }
   }
}

}

function unReleased()
{
   //BONUS Section
   var sou:Sound = new Sound();
   sou.attachSound("sdown");
   sou.start();
   
   delete this.onRelease;
   var tw:Tween = new Tween(theText,"_alpha",Strong.easeOut,100,0,0.5,true);
   var tw:Tween = new Tween(holder,"_alpha",Strong.easeOut,100,0,0.5,true);
   var tw4:Tween = new Tween(t,"_alpha",Strong.easeOut,20,100,2,true);
   for(var i=0;i<numOfItems;i++)
   {
      var t:MovieClip = home["item"+i];
      if(t != this._parent)
      {
         //var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,0,t.theScale,1,true);
         //var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,0,t.theScale,1,true);
         //var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,0,100,1,true);
      }
      else
      {
         var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,100,t.theScale,1,true);
         var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,100,t.theScale,1,true);
         var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,t.xPos,1,true);
         var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,t.yPos,1,true);
         tw.onMotionStopped = function()
         {
            for(var i=0;i<numOfItems;i++)
            {
               var t:MovieClip = home["item"+i];
               t.icon.onRollOver = Delegate.create(t.icon,over);
               t.icon.onRollOut = Delegate.create(t.icon,out);
               t.icon.onRelease = Delegate.create(t.icon,released);
               t.onEnterFrame = mover;
            }
         }
      }
   }
}


function moveTip()
{
   if (this._parent._y<centerY) {
   home.tooltip._alpha = 0
   home.tooltip._x = this._parent._x;
   home.tooltip._y = this._parent._y + 10;
   }

else {home.tooltip._alpha = 100
   home.tooltip._x = this._parent._x;
   home.tooltip._y = this._parent._y + 10;
}
}

xml.load("modellen/modellen.xml");

function mover()
{
   this._x = Math.cos(this.angle) * radiusX + centerX;
   this._y = Math.sin(this.angle) * radiusY + centerY;
   var s = (this._y - perspective) /(centerY+radiusY-perspective);
   this._xscale = this._yscale = s*100;
   if (this._y<centerY) {this._alpha = 0}
   else {this._alpha = 100}
   this.angle += this._parent.speed;
   this.swapDepths(Math.round(this._xscale) + 100);
}

this.onMouseMove = function()
{
   speed = (this._xmouse-centerX)/15000;
}

View Replies !    View Related
AS3 Class Holder
I had to edit my post to clear it up a bit!
why does the text field work without the holder, but when I try to add it to the mc holder it doesn't show up? this should be basic!
Code:

package
{
   import flash.display.MovieClip;
   import flash.text.TextField;
   import flash.text.*;
   
   public class Calendar extends MovieClip
   {
      private var holder:MovieClip;
      private var tf:TextField;
            
      public function Calendar(sWidth, sHeight):void
      {
         holder = new MovieClip();
         holder.x = 0;
         holder.y = 0;
         holder.width = sWidth;
         holder.height = sHeight;
         addChild(holder);
         
         tf = new TextField();
         tf.width = 200;
         tf.text = "Hello World";
         tf.selectable = false;
         tf.x = sWidth/2;
         trace(sWidth/2);
         tf.y = 5;
         
         addChild(tf);    // this does work but not in the holder?
         //holder.addChild(tf);  //this doesn't work why???
         
      }
   }
   
}

my Document Class
Code:

package
{
   import flash.display.MovieClip;
   import Calendar;
   
   public class DocumentClass extends MovieClip
   {
      public var cal:Calendar;
      
      public function DocumentClass():void
      {
         cal = new Calendar(this.stage.stageWidth, this.stage.stageHeight);
         addChild(cal);
      }
   }
   
}


I know I'm missing something basic??

View Replies !    View Related
AddChild To Holder - CS3
I am very new to cs3.
Have used the code below to load a .swf file to my project.

What I would like to do is load the .swf to a holder_mc so that I can control the positioning of the file.

I will have five buttons that will load various .swf files. I would like to load each of them into the holder_mc when the corresponding button is clicked.

The last button is the home button. When this is clicked it should remove all of the .swf files from the holder_mc.

Does this make sense? Any help would be greatly appreciated.


import flash.events.MouseEvent;
import flash.display.MovieClip;
import flash.display.Loader;
import flash.events.*;
import flash.net.URLRequest;

var imageLoader:Loader = new Loader();
var theURL:String = "New4thfloorStar.swf";
var imageRequest = new URLRequest(theURL);

imageLoader.load(imageRequest);

FourthFloor_btn.addEventListener(MouseEvent.CLICK, FourthFloor_btn_Click);
function FourthFloor_btn_Click(event:MouseEvent):void
{
addChild(imageLoader.content);
}

View Replies !    View Related
.swf Scaling In Holder
Hi everyone! Since this is my first post i would like to start off with saying thank you! I came across this website about a week ago and i have spent every minute of my free time trying to absorb as much as possible. By far the best web design learning tool I have seen anywhere. Lee Brimelow your video tutorials are A++ and thank you.

<Ok now to the plz help me part>

I'm a graphic designer trying to make the transition to full blown flash designer. The problem is I have no training or knowledge in any type of code. So its been very painful but in the mater of a week thanks to a few of your tutorials I was able to get started on a nice little portfolio site. But now I'm stuck in a few spots and have spent many of hours searching this forum and others to no avail. I need some help from you action script wizards! I'm sure these are nubish problems : (

Tutorials I used:
Creating 3D Carousels 1-3
External SWF Preloading

Website http://snovagraphics.com/
-it is really bar but I'm trying to make sure the functionality of the actionscript is working first

Problem #1
I have all the icons in the carousel pulling up .swfs from the xml. On the "Flash Design" link i used the External SWF Preloading actionscript. What I'm having trouble with is making the .swf holder scale the .swfs to its size, so i don't have to go back and resize all my flash .swfs.

I have seen this and tried plugging in the "holder.scaleContent = true;" command in every spot but I'm missing something.
Code:

  // Create a listener object event function. The progress bar is an object so it needs an object function to work
    myProgressBarListener = new Object();

    // When the progress bar is complete and has preloaded the loader component content, the listener will call and run this code below:
    myProgressBarListener = function (eventObject) {

        // Hide the progress bar now as we don’t need it any more
        myProgressBar._visible = false;

    // Closes the above function
    };

    // Sets whether the content being loading into the loader component scales to fit the loader (true), or the loader scales to fit the content (false)
    [b]myLoader.scaleContent = true;[/b]

    // Set the location of the content to be loaded. Examples are:
    // myLoader.contentPath = "http://www.YourWebSite.com/images/myImage.jpg";
    // myLoader.contentPath = "http://www.YourWebSite.com/myFlashMovie.swf";
    myLoader.contentPath = "imagine.swf";

    // Declares a listener that detects when the progress bar component has loaded the loader component content and is complete. Then calls the function myProgressBarListener
    myProgressBar.addEventListener("complete", myProgressBarListener);

    // Set up the progress bar component variable to polled mode which determines the maths behind the % counter.
    myProgressBar.mode = "polled";

    // The location of the Loader Component
    myProgressBar.source = "myLoader";

    // Sets the conversion to 1. This basically means the component divides the current and total values loaded and to be loaded. Then it floors them (works out the difference between them) and displays the converted value in the label property
    myProgressBar.conversion = "1";

    // Set the label to display the word 'loading' followed by the percentage value loaded so far
    myProgressBar.label = "LOADING %3%%";

    // The direction the progress bar moves when loading
    myProgressBar.direction = "right";

    // The location of the label that displays the percentage loaded so far
    myProgressBar.labelPlacement = "bottom";

   
    // Stops the Playhead in the current frame until the Movie has been preloaded
    stop();


my actionscript
Code:

var mcl:MovieClipLoader = new MovieClipLoader();

var mclL:Object = new Object();

mclL.onLoadProgress = function(target,loaded,total) {
   loader.percent.text = Math.round((loaded/total) * 100) + "%";
}
mclL.onLoadInit = function() {
   loader._visible = false;
   loader.percent.text = "";
}

mcl.addListener(mclL);
   
b1.onRelease = function() {
   loader._visible = true;
   mcl.loadClip("imagine.swf",holder);
   
}

b2.onRelease = function() {
   loader._visible = true;
   mcl.loadClip("swf2.swf",holder);
}


Problem #2
The "Resume" icon pulls up my resume in a .swf holder as well. I would like it to stay contained in the holder and not run off the screen and use a slider bar to scroll up and down to view it. And maybe a fade effect at the bottom of the screen using a transparency. Not sure how to start this actionscript.

Thanks in advance for any help and comments or criticism will be very appreciated

View Replies !    View Related
Using A .txt File As A Place Holder
I think I need to use a .txt file to create a place holder (bookmark) for a standalone application created with Flash Player. I know how to create the .txt via the fscommand but don't understand how I can use the .txt to create a place holder so the player would open at the location the user was last at in the player. Can anyone help?

View Replies !    View Related
LoadMovie...Help Aligning The New SWF Into The HOLDER
Hi...

I need some help...I can use loadMovie to load a new SWF into an empty instance of a MovieClip...however I also found out from another forum that the reference point for the new SWF is its center and the reference point for the HOLDER is the upper left corner....so the movies are not aligned right in holder....

problem is ... how do i compensate for this?? if the holder is 200x200 pixels do i make the SWF to be loaded 800x800 and use the lower right 200x200 or is there a better way ?

thanks for the help...

:-)

View Replies !    View Related
Loadmovie To Holder Or Into Level?
Lets say i want to create a full flash site. And my different sections will have some mild interaction. SHld i load the sections into levels or make placeholders in the main timeline and load them inside? which one is better?

View Replies !    View Related
Unload Movieclips In Holder.
i have attached movie clips to a links_holder movieclip. Lets say i want to remove all attach clips inside links_holder movieclip. wats the fastest way to do tat? cos i may have different links inside the links_holder at different times

View Replies !    View Related
Load Into Holder Or _level?
I've been reading some of the posts regarding loading external swfs. I have always done this into holder MCs as at design time I can use this to better visualise how things will look with a dummy image in the mc.

I am however getting the impression that the better practice is to load into levels, Is this the case and if so could someone explain as to why? I am about to embark on my next flash project so would like to get best practices in place from the offset.

Cheers

View Replies !    View Related
Gallery..empty MC Holder
hi,

could some one tell me what is the easiest way of achieving the following:

create empty holder for thumbnails that are 93x92 dynamically, also when clicked to load the original size for viewing and I also want to have some scrolling system.
what code would go on the scrolling button 'rigt_scroll' and 'left_scroll'?. Also to be able to handle about 50 images.

thanks your help will be appreciated.

unisa

View Replies !    View Related
Making An Invisible Holder?
i'm wondering how to make an invisible holder movie clip for loading externally stored jpgs. i've made other sites where the holder mc's sat on a solid background color, and i could make them invisible just by making them the same as the background color. but for this site, the background is an image, like a photograph.

would you recommend copying and pasting that part of the background image where the images would load, and use that as the background layer of the holder clip, then paste that movie clip back into place on top of the original image, or is there a simpler way?

any suggestions are much appreciated.

View Replies !    View Related
External Imagesnot In Holder
hey,
u guys, im makin a gallery loading external images in a holder.
My porblem is when the images load they arnt centered and they're loading outside of the holder... how can i fix that?
code is:

function load_jpg_or_swf(targetMC, jpgURL) {
this.holder.mtClip.loadMovie(jpgURL);
loadMC.loadtarget = this.holder.mtClip;
attachMovie("loader", "loadMC", 1000);
loadMC.loadtarget = this.holder.mtClip;
loadMC.onEnterFrame = is_loaded_results;
loadMC._x = 200;
loadMC._y = 20;
}
function is_loaded_results() {
this.proportionloaded = this.loadtarget.getBytesLoaded()/this.loadtarget.getBytesTotal();
this.percentage = this.proportionloaded*100;
this.displaypercentage = Math.floor(this.percentage)+" %";
_root.loadMc.bar._xscale = Math.floor(this.percentage);
if (this.proportionloaded == 1) {
this.removeMovieClip();
}
}
b1.onRelease = function() {
yourJPGurl = "images/frost.jpg";
// works with jpg or swf!!!
load_jpg_or_swf(mtClip, yourJPGurl);
};

View Replies !    View Related
Problem Loading JPG Into Holder - Please Help
Hey all...

I have two SWFs: one has 37 buttons, each button instance navigates through an XML document displaying location specific information onRollover. onPress, the XML node references (image[3], etc...) are sent using localConnection to the second SWF........

All that works fine and dandy, but i am trying to load JPG's into a holder on the second SWF (from thumbnailPath[i]). They load; but the proportions are somehow getting changed... shrinking the .JPG with what seems to be arbitrary proportions. If you are familiar with the Kirupa Slideshow tutorial, the JPG images are being loaded into the MC instance 'picture', which is masked to a rectangular shape layer. I am not setting any dimension or placement properties dynamically.

I have loaded JPGs into holders this way many times and have never encountered a scaling problem... I guess this is a kind of "old-school" way of loading .jpgs, but i am not confident about creating an empty MC, passing the XML path and loading the .JPG (of all different dimensions, this will ultimately be a CMS app)

Any hints, suggestions or information would be much appreciated. Thanks a lot everybody!

// Begin AS

var xmlReceivePath = ("xml_mapinfo3.xml");

/////////////////////////////////////

function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
ownerRec = [];
interestRec = [];
townRec = [];
establishedRec = [];
acreageRec = [];
shorelineRec = [];
thumbnailRec = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
ownerRec[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
interestRec[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
townRec[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
establishedRec[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
acreageRec[i] = xmlNode.childNodes[i].childNodes[4].firstChild.nodeValue;
shorelineRec[i] = xmlNode.childNodes[i].childNodes[5].firstChild.nodeValue;
thumbnailRec[i] = xmlNode.childNodes[i].childNodes[6].firstChild.nodeValue;
}
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(this.xmlReceivePath);

/////////////////////////////////////

stop();
var receiver:LocalConnection = new LocalConnection();
_root.onEnterFrame = function() {
receiver.doAction = function(loaded:Boolean, locationVal:Number, OwnerRecVal:String, InterestRecVal:String, TownRecVal:String, EstablishedRecVal:String, AcreageRecVal:String, ShorelineRecVal:String, ThumbnailRecVal:String) {
delete _root.onEnterFrame;
if (loaded) {
result_txt.text = OwnerRecVal;
owner_txt.text = OwnerRecVal;
interest_txt.text = InterestRecVal;
town_txt.text = TownRecVal;
established_txt.text = EstablishedRecVal;
acreage_txt.text = AcreageRecVal;
shoreline_txt.text = ShorelineRecVal;
picture.loadMovie (ThumbnailRecVal, "GET");
purchasedLbl_txt.text = "PURCHASED:";
acreageLbl_txt.text = "ACREAGE:";
shorelineLbl_txt.text = "SHORELINE:";
_root.gotoAndPlay(2);
}
};
receiver.connect("parentConnection");
};

View Replies !    View Related
Create Movieclips In Holder?
I'll try again... I'm trying to make a picture galley, and I'm having problems. I have this code, that works fine. I take the names of my pictures from MySWl via PHP and load them into my loadvars object (picReceiver). Then i loop through it finding the ones that have the sepcified category (c).

It works fine, but I want to put them in a Movieclip so I can scroll the thumbnails if they overflow the MC area. The problem is, that if I add a container, every time the loop goes through it replaces the content that is in it.... so I end up with just the last picture instead of all the pictures shown.

I want to create all of the movieclips in on MC, but can't figure out how to do


Code:
function showPictures(c)
{
var Positioner:MovieClip;
for (i = 0; i < picReceiver["n"]; i++)
{
if(picReceiver["album"+i] == c)
{
Positioner = createEmptyMovieClip("pic"+i, getNextHighestDepth());
loadMovie("billedgalleri/small/"+picReceiver["navn"+i], "pic"+i);
Positioner._x = 60*albumsMade;
albumsMade++;
}
}
albumsMade = 0;
}

View Replies !    View Related
[HELP] Holder Class Not Working
Okay, I'm one of those guys who are awesome at Actionscript 2, and then when it comes to Actionscipt 3, there's a brick wall in my way. I have scripted in javascript before for my Computer Science class that I took in my senior year (last year), and personally I think Actionscript 3 is harder than it.

So basically I have problem. I have created a class called NoteHolder, and it is just a holder class for another class of Notes which extends MovieClip. So heres the code...


Code:
package {

import flash.Display.Sprite;
import flash.events.Event;

public class NoteHolder extends Sprite {

public var children:Array;

public function NoteHolder() {
children = new Array();
addEventListener(Event.ADDED_TO_STAGE, init);
}
public function init(e:Event):void {
for (var i:uint = 0; i < 4; i++) {
var n:Note = new Note("1", 20+i*20);
children.push(n);
trace(children[n]);
addChild(n);//go on the display list.
}
}
}
}
So the problem is that it is not displaying the notes. And when I trace with trace(children[n]); I get this.

undefined
undefined
undefined
undefined

So I just want to know what I did wrong and how to fix it. I know I'm a noob at this, please be nice!

View Replies !    View Related
Linking From Drop Down To Swf In Holder
Using CS3 i have created a simple drop down menu from a button with 4 other buttons underneath. Underneath these buttons is a movie clip holder and when the buttons from the drop down are clicked a .swf is meant to appear within the holder. I am having no problem linking other single stand alone buttons to play in the holder but only am with the buttons coming off the drop down menu, is it possible to do this? I am currently using the following code.

on (release){
loadMovie("filename.swf",holder);
}

And when clicked upon a button from the drop down menu it simply just does not play anything within the holder.

Thanks for reading, hope someone has an idea.

View Replies !    View Related
Test A Holder Mc For Content
Good morning...

I have a 'holder' movie clip in a swf that loads an external swf depending on which button the user selects. While the user is viewing the content for the selected button in the 'holder' mc; I would like to disable all of the buttons in the top level swf and when the user clicks close in the external swf or the external swf is done, I would like the buttons to be enabled. I have written two functions, one that disables the buttons and one that enables them. I have no problem disabling the buttons; but getting them enabled after the external swf is unloaded has been a problem.

I was wondering if anyone knew of any code that can continuously check the 'holder' mc to see if it has an external swf loaded. If the code returned that the 'holder' had a swf loaded then it would run the disable buttons function. Likewise, if the code returned that the 'holder' was empty, it would run the enable buttons function.

Any help on this would be greatly appreciated.

-john

View Replies !    View Related
How To Check Holder Contains Which Video
Hello Guys

I have designed a flash player, where i upload videos using the xml file. I have two videos partI and partII, now what i am looking for is when movie partI finishes playing the movie partII should start playing.

to some extend i am able to do this, when the movie partI finishes the movie partII plays, but when the movie partII keeps on playing again and again i want it to play only once.

Can some one tell me how to check which movie is loaded into the container

one more thing i was looking for is when the movie partII is playing and the user presses the rewind button it should rewind till the user presses stop button, during this time if the movie partII has reached 1st frame it should automatically go to movie partI and keep rewinding till the player presses stop

Can some one please help me with this

Thanking in advance
Shriram

View Replies !    View Related
Can't Attach Movie To Holder
I'm trying to create a simple site that when one clicks on the "biography" link the "bio" movie clip attaches to the holder in the parent.

For some reason the answer to this seemingly simple perdicament is out of my reach... please help... the flash file is attached.

View Replies !    View Related
Movie Clip Holder
I have placed an empty movie clip (holder) on a labeled frame (show) on my time line. I have beeen trying to use "attachMovie" to attach 20 internal MC's.

The idea is that everytime you enter frame (show) the empty MC (holder) would play 1 of the 20 internal clips (Q_01, Q_02, Q_03... Q_20). The one that is played is determined my the value of varialble (currentQ). So if (currentQ)=3 then when you enter frame (show) empty MC (holder) would play inernal MC Q_03.

I have had some luck promted by a button however it is when I try to use onClipEvent (enterFrame) that I run into a problem.

Any Ideas or links?

View Replies !    View Related
Imported Mod Talkto To Holder
Is there a way to have a imported .swf talk to the .swf that loaded it?

View Replies !    View Related
Help Me With Preloading In Movie Holder
Hi.. i have a problem in my webpage. My problem is when i using a multiple swf file to load with my MovieClip holder. It does'nt streaming. but i put every actionscript for preloading every swf.. but when i uploaded it and checked if the preloading is working properly.its not working .its working on the main swf.. but the rest it display a blank screen then after a few minutes it display complete animation..I only want to see is a loading animation before it show a whole swf animation..what code should i use ..if you want to check what is seems to be the problem please..check out my webpage. at http://www.wilcren.vze.com.....

i hope you could help me
and give some idea..thanx ..q^_^p

your student
wilperson..

View Replies !    View Related
Duplicate Movieclip Holder
hey guys i sent up a question for a lego game3 weeks ago -- i got the game to work splendid thanks guys

heres a link--
http://www.rit.edu/~ast7707/finalprojectok5.swf


i have a question though
--They duplicate and stuff but i want it to stop duplicating if the previous clip is not moved from where it was duplicated


heres the code im using to duplicate the movieclips

on (release) {
music = new Sound();
music.attachSound("click10");
music.start(0, 1);
if (i<900) {
duplicateMovieClip("_root.box3red", "box3red"+i, i);
_root["box3red"+i]._x = random(30)+50;
_root["box3red"+i]._y = random(60)+50;
_root["box3red"+i].onRelease = function() {
trace(this._name);
delete this.onMouseMove;
};


_____________________________________

What i want to do next is save the pieces and ne able to load games --if it can be done do i use xml, asp, flash remoting?

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved