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








Place Multiple Images Into Movieclip Dynamicly


Hello professional actionscripters. I'm trying to make a series of circles, or rings, which thumbnail images rotate around, kind of similar to a carousel, but not all 3d and stupid web 2.0 looking. Anyway, I have the rotating part working with multiple movieclips attached, but I don't know how to place different images into a single movieclip so that every thumbnail is a different image. I would like to do this by having all my images within my library, since its a small site. THe


var numOfItems:uint = 2; // number of Items to put on stage
var radiusX:uint = 75; // width of carousel
var radiusY:uint = 75; // height of carousel
var centerX:Number = stage.stageWidth / 2; // x position of center of carousel
var centerY:Number = stage.stageHeight / 2; // y position of center of carousel
var speed:Number = 0.02; // initial speed of rotation of carousel


init();

// place Items on stage
function init():void {
for(var i:uint = 0; i < numOfItems; i++) {
var item:Item = new Item();
// public var angl:Number; is in Item class.
// Item class extends ItemInner in FLA library.
item.angl = i * ((Math.PI * 2) / numOfItems);
item.alpha = 1;

addChild(item);
item.addEventListener(Event.ENTER_FRAME, enterFrameHandler);

}
}

// position Items in elipse
function enterFrameHandler(event:Event):void {
event.target.x = Math.cos(event.target.angl) * radiusX + centerX; // x position of Item
event.target.y = Math.sin(event.target.angl) * radiusY + centerY; // y postion of Item


event.target.angl += speed;


}



this is a class I'm using called Item



package {

public class Item extends ItemInner {

public var angl:Number;


}
}


ItemInner is the moveclip I need to place on the rings, and it is also a class for that clip. If you have any ideas please let me know. Thanks




FlashKit > Flash Help > Actionscript 3.0
Posted on: 03-07-2008, 11:29 AM


View Complete Forum Thread with Replies

Sponsored Links:

Place Dynamicly Created MCs Inside Existing MC?
Hi there,

Can anybody help me out here please...

EDITED --> Please look further down for question

Thanks

View Replies !    View Related
Loading Multiple Swf's Dynamicly
Hey,

Im trying to make a preloader with a percentage bar that will load mulitple external swf/jpgs. ie. Load one thumbnail/image and then another placed next to it .

Is there any way to do this so that if you want to add more swf/images, you simply add the path somewhere? perhaps xml?

-Bowds

View Replies !    View Related
Loading Images Dynamicly
ok heres my issue...

I am loading images Dynamicly to my _root.background.walllayer
they load fine... but i cant get them to center...

here is my code for my button
on (release) {
loadMovie("wall2.jpg", "_root.background.walllayer");
_root.background.walllayer._x = 0;
_root.background.walllayer._y = 0;
gotoAndStop(2);
}

how do i set the X and Y axis Variables on my _root.background.walllayer layer?

View Replies !    View Related
Dynamicly Loading Images
I am currently working on a project that requires the dynamic loading of gifs and pngs. Now here is the catch. I would like to use flash 8 to load the image then pass it to a flash 7 swf. (Due to some larger issue I am constrained to use the flash 7 doc) So here is my question. Is there a way to pass and image loaded with flash 8 to a movieclip in the flash 7 swf. I am not particular on how the two files are set up. ie: nested or as two separate swf files so long as I can get the image into the flash 7 swf somehow. Thanks for your help. I am kind of stuck here

View Replies !    View Related
Scrolling Dynamicly Loaded Images
hi there,
ok. I have a list, which is some txt and its corresponing image which in the end should both be loaded into flash externally.
Now I want to scroll the whole thing nicely.
I am managing to scroll the text fine with dynamic txt-box and an external .txt file...but I dont know how I can incorporate the image which should scroll alongside with it .
Any sugestions?
cheers,
sandra

View Replies !    View Related
Dynamicly Loading Transparent Images
Since you can only load in JPG's and SWF's Does anyone know a technique to load in transparent images and keep the transparency?

I was thinking that you could write something server side that would convert a Transparent PNG or GIF into a SWF that somehow keeps the transparency. Then load that Swf into your main movie.

Anyone know if this is possible or has done it before?

-Dice

View Replies !    View Related
Loding Images Dynamicly Into Movie
Hello, heres the problem, I can load the images I want into the movie clip, but when I try and target them using the root command it wont work.

Im not the best at explaning the file is here ZIPhttp://www.shmooze.ca/zip.zip

If some one could help me I would be there best freind !

But for real any help would be great

Bill

View Replies !    View Related
How To Preload Many Dynamicly Loaded Images
I need to print more pictures. Pictures are on my server. When visitor press button, this code load pictures to the print_MC :


PHP Code:



myBtn.onPress = function() {
    var all_Pic = 20;  // this is dynamic variable
    posY = 5;
    posX = 5;
    for (var i = 0; i<all_Pic; i++) {
        print_MC.attachMovie("imgHolderLib", "imgHolder"+i, i, {_x:posX, _y:posY});
        loadMovie("www.domain.com/images/"+i+".jpg", "print_MC.imgHolder"+i);
        posX += 250;
        if (posX>=760) {
            posY += 100;
            posX = 5;
        }
    }
};




I need print this movie clip, but witout preloader it prints only pictures, that are loaded. So, how to preload all pictures ? Any solution ?

.

View Replies !    View Related
Dynamicly Moving Images Issue
I am working on a image slider. Pretty simple really its controlled by mouse position on stage. If its on the right the images slide to the right etc. once the image slides of the stage it gets moved to the other side behind the other images. It works with one problem the after a while the images start running into each other as they dont appear to be getting placed correctly or moving at the same speed. Not sure why some movie clips would be moving at different speeds then others when its the same code. The code is pretty simple so I am not sure what is breaking it.

the code is pretty simple I have a container mc called newsB in that are dynamicly created clips that hold the news images as you mouse over either the right side of the stage or left they move in that direction. if the newsMC goes of the stage it is relocated to the other side at the end of all the clips. It works but is bugy in the sense that images eventually start to run into each other.

Code:


function Scroll(Lspeed) {
if (_xmouse>Stage.width/2) {
for (p=0; p<=newsCount; p++) {
_root.newsB['newsMC'+p]._x = _root.newsB['newsMC'+p]._x-Lspeed/10;
if (_root.newsB['newsMC'+p]._x+newsMcWidth<0) {
_root.newsB['newsMC'+p]._x = wraperWidth-1;
}
}
}
if (_xmouse<Stage.width/2) {
for (p=0; p<=newsCount; p++) {
_root.newsB['newsMC'+p]._x = _root.newsB['newsMC'+p]._x+(Lspeed*-1)/10;
if (_root.newsB['newsMC'+p]._x>wraperWidth) {
_root.newsB['newsMC'+p]._x = 1-newsMcWidth;
}
}
}

}
var intervalId:Number;
function executeCallback():Void {
Scroll((_root._xmouse-Stage.width/2)/4);
}
intervalId = setInterval(this, "executeCallback", 20);
hope that makes sense
thanx dave

View Replies !    View Related
Preloading For Dynamicly Loaded Images Through Php
Hello,

I have a swf file and I'm loading 5 images in it through a php file. I have 5 movie clips for each image. My problem is that I can't make them wait one after another when they load. I want to load the first, than, when it is loaded to load the second and like this for all 5 images. Can anyony help me?

Here is part of my code at the moment:

Code:
RM.onLoad = function (success) {
if (success) {
loadMovie("mysqldata.php?pg="+pg+"_01&res="+res, p3_1);
loadMovie("mysqldata.php?pg="+pg+"_02&res="+res, p3_2);
loadMovie("mysqldata.php?pg="+pg+"_03&res="+res, p3_3);
loadMovie("mysqldata.php?pg="+pg+"_04&res="+res, p3_4);
loadMovie("mysqldata.php?pg="+pg+"_04&res="+res, p3_5);
} else {
error.text = "Ther is an error while downloading images";
}
}

View Replies !    View Related
How To Preload Many Dynamicly Loaded Images
I need to print more pictures. Pictures are on my server. When visitor press button, this code load pictures to the print_MC :


PHP Code:



myBtn.onPress = function() {
    var all_Pic = 20;
    posY = 5;
    posX = 5;
    for (var i = 0; i<all_Pic; i++) {
        print_MC.attachMovie("imgHolderLib", "imgHolder"+i, i, {_x:posX, _y:posY});
        loadMovie("www.domain.com/images/"+i+".jpg", "print_MC.imgHolder"+i);
        posX += 250;
        if (posX>=760) {
            posY += 100;
            posX = 5;
        }
    }
}; 




I need print this movie clip, but witout preloader it prints only pictures, that are loaded. So, how to preload all pictures ? any solution ?

.

View Replies !    View Related
Dynamicly Loading Scrolling Images Help
what i am trying to do in the end is make a scroll bar that dynamicly loads its
images as imagei.jpg then image2.jpg....
i did that but here is the trouble
i need to make them scroll u can see everything i tryed to do
i have a little extra useless stuff just ignore it

stop();

this.addEventListener(Event.ENTER_FRAME,onef);


var container = new MovieClip();
var num:Number = 0;
var numb:Number = 150 ;
var trc:Number = 0;
var mylBtn:Loader = new Loader();
var myrBtn:Loader = new Loader();
var m:Number= 1;
var vpv:Number = 1;
var mySpeed:Number=0;
var myCount:Number=0;
var keepMoving:Boolean;
var leftdown:Boolean;
var rightdown:Boolean;
leftdown=false;
rightdown=false;
keepMoving=true;




/*for(var i:Number=0; i<50; i++)
{
var bob = container["test" + i] = new MovieClip();
var bo = "test" + i
var src = "http://www.freewebs.com/virtualeating.background.jpg" + i +""
bob;
num += 1;
bob.x += num;
trace(bob.x);
}
*/

for(var b:Number=1; b<5; b++)
{

var myLoader:Loader = new Loader();
addChild(myLoader);
var url:URLRequest = new URLRequest("http://www.freewebs.com/tabcvideo/tvi" + b + ".JPG");
myLoader.load(url);
myLoader.x += numb;
trace(numb);
numb += 150;
myLoader.addEventListener(MouseEvent.MOUSE_DOWN, error);
//myLoader.addEventListener(MouseEvent.MOUSE_OVER, error);
}


addChild(mylBtn);
var urlb:URLRequest = new URLRequest("http://www.freewebs.com/tabcvideo/tvi4.JPG");
mylBtn.load(urlb);
mylBtn.x == 0;
addChild(myrBtn);
var urlbr:URLRequest = new URLRequest("http://www.freewebs.com/tabcvideo/tvi4.JPG");
myrBtn.load(urlbr);
myrBtn.x = numb;

mylBtn.addEventListener(MouseEvent.MOUSE_OVER, leftover);
mylBtn.addEventListener(MouseEvent.MOUSE_OUT, leftnover);
myrBtn.addEventListener(MouseEvent.MOUSE_OVER, rightover);
myrBtn.addEventListener(MouseEvent.MOUSE_OUT, rightnover);









function error(event:Event):void{
trace(trc);
trc += 1;
}
function leftover(event:MouseEvent):void{
leftdown = true;
trace(numb);
trace(leftdown);
}
function leftnover(event:MouseEvent):void{
leftdown = false;
trace(leftdown);
}
function rightover(event:MouseEvent):void{
rightdown = true;
}
function rightnover(event:MouseEvent):void{
rightdown = false;
}

function stopBar(event:MouseEvent):void {
keepMoving = false;
}
function startBar(event:MouseEvent):void {
keepMoving = true;
}


function onef(event:Event):void {

if(leftdown){

for(var bb:Number=1; bb<5; bb++)
{
var cheese = "myLoader"+bb+""
myLoader.x += 150;

}
}
}

//for(var b:Number=1; b<5; b++)
//{
//myLoader[b].x += 200;
//myLoader.addEventListener(MouseEvent.MOUSE_OVER, error);
//}
//}
// CHECK FOR RESTART
/*if (myCount >= 1671.0){

myLoader.x=-536;
myCount=536;

}else{
if (myCount <= 81.0){
myLoader.x=-1206.0;
myCount=1206.0;
}

// CHECK FOR MOVEMENT OF SCROLLING MOVIE
if (keepMoving){
myLoader.x -= mySpeed;
myCount+= mySpeed;
}
}
*//*
//}
if(rightdown){
mySpeed -= 1.0;
}
if(mySpeed > 20){
mySpeed= 10;
}
mySpeed = mySpeed * 0.95;

}



//you could then dispatch this like so
//in hboxvar
//you would have to import your custom event
dispatchEvent( new CustomEvent( CustomEvent.MOUSE_DOWN, "1,2,3") )

//again your would need to import your custom event
hboxvar.addEventListener( CustomEvent.MOUSE_DOWN, dosomething );

private function dosomething( event:CustomEvent ):Void
{
trace( event.myString ) // 1,2,3
}
*/

View Replies !    View Related
Problem Dynamicly Loading Images
Hi guys,

I have a problem I have a logo.png which i want to display above al sorts of images which are loaded from a directory.

For example:


This image should always be on top, the following images should be loaded under the logo.png

Examples:



Which should result in something like this:


I got a FLA with some code in it, but i can't get it to work. Who can help, my logo keeps disappearing while the photos show up.

View Replies !    View Related
Dynamicly Load Unknown Amount Of Images
if i want to dynamicly load images from a folder, but donīt know how many pictures there are in the folder and the names of the pictures are something i canīt control so when i load the images i donīt know the names. How do i achieve this?

View Replies !    View Related
Problems With ._height With Dynamicly Loaded Images
Hi guys/gals!

I am looking for a way to get the height of an image. Normally I would use this._height. But the problem is that I load my iamges from an xml file. this._height now gives Undefined so the rest of my actionscript is worthless.

Can anybody help me here? Looks easy...the height of an image...But i can't get it right

it's pretty urgent...needs to be fixed today!

THANX!

View Replies !    View Related
[F8] Dynamicly Load Images To BitmapData Filer
Hi

I have an xml file with contains information about backgrounds that i would like to be "selectable" by the viewer. I've loaded the information usig xml and came up with this:


Code:
xmlBackground = new XML();
xmlBackground.ignoreWhite = true;
xmlBackground.onLoad = function(success) {
if (success) {
bgNode = this.firstChild.childNodes;
for (var i=0; i<bgNode.length; i++) {
trace(bgNode[i].firstChild.nodeValue);
}
}
};
xmlBackground.load("xml/backgrounds.xml");


This will return "image1.jpg" and "image2.jpg" etc etc.

I then use this code to load an image:

Code:
import flash.display.BitmapData;

var tile:BitmapData = BitmapData.loadBitmap("tile");

function fillBG() {
this.beginBitmapFill(tile);
this.moveTo(0,0);
this.lineTo(Stage.width,0);
this.lineTo(Stage.width,Stage.height);
this.lineTo(0,Stage.height);
this.lineTo(0,0);
this.endFill();
}

fillBG();


And this is the way how to "change" which image that the filter should contain:

Code:
on(release)
{
import flash.display.BitmapData;
tile.dispose();
var tile:BitmapData = BitmapData.loadBitmap("tile2");
fillBG();
}


The problem is that i want to load the bitmaps dynamicly and apply them to the filter. For example if you press on a button, an image will load in the bitmapdata filter. If you press another it will load that one.

I would be really glad if someone could help me, it shouldn't to hard (most of the code is already done :P)

Thanks!

View Replies !    View Related
Loading Number Of Images In One Swf File Dynamicly
I am working on php shopping site. I want to load different images in one swf file. Here is the example if you click plus button (agrandir) it will open popup and this is flash file.

do i need to make separate swf file for each product or can I use one swf to load all images one by one? is there any solution?: mad:

View Replies !    View Related
Loading Number Of Images In One Swf File Dynamicly
I am working on php shopping site. I want to load different images in one swf file. Here is the example if you click plus button (agrandir) it will open popup and this is flash file.

do i need to make separate swf file for each product or can I use one swf to load all images one by one? is there any solution?

View Replies !    View Related
AS3 Toggle Button With Dynamicly Loaded Images
I have a flash file that loads an xml. It then populates a movieclip container with small images that act like buttons. The location, x and y coordinates are stored in the xml.

These buttons need to be toggled off and on with a mouseclick. Clicking one button, toggles the clicked one on, and all the others off etc. Only 1 should be active at the time. How do I accomplish this? I can activate it, but not deactivate it

The button actions
links = xml.lenght
loc[i] = name of the image

PHP Code:



function mouseListener(event:MouseEvent) { switch (event.type)  {//[...] Removed unintersting part for readability  case MouseEvent.CLICK ://If the button pressed name, doesnt correspond with the name //of the rest of the buttons, add new eventlistener to it(that got //removed when clicked)   for(var i:int=0; i < links; i++)   {    if(loc[i] != event.target.name)    {     addEventListener(MouseEvent.MOUSE_OVER, mouseListener);      addEventListener(MouseEvent.MOUSE_OUT, mouseListener);     }   }     //change the color of the button clicked and remove the //mouseevents, so it doesnt trigger a mouse out which puts the// color back off, then fire a function   TweenFilterLite.to(event.target, 0.25, {colorMatrixFilter:{colorize:tint, amount:1}});      event.target.removeEventListener(MouseEvent.MOUSE_OUT, mouseListener);    event.target.removeEventListener(MouseEvent.MOUSE_OVER, mouseListener);   doSomething(event);     break; }} } 




Here is the xml function


PHP Code:



function showXML(e:Event):void { XML.ignoreWhitespace = true;  sitemap = XML(e.target.data); links = sitemap.link.length(); var brnArray:Array; var i:int = 0; //walk the xml and put the values in different arrays so I can access them globally later on for (i = 0; i < links; i++)  {  loc.push(sitemap.link.loc[i].text());  locx.push(sitemap.link.locx[i].text());  locy.push(sitemap.link.locy[i].text());  tracktype.push(sitemap.link.tracktype[i].text());  lname.push(sitemap.link.name[i].text());   var spotloader:Loader=new Loader();  spotloader.load(new URLRequest("images/hotspots/"+ tracktype[i]+".png"));  spotloader.x = locx[i] - spotloader.width/2;  spotloader.y = locy[i] - spotloader.height/2;  spotloader.name = loc[i];  spots.addChild(spotloader);   spotloader.addEventListener(MouseEvent.CLICK, mouseListener);  spotloader.addEventListener(MouseEvent.MOUSE_OVER, mouseListener);  spotloader.addEventListener(MouseEvent.MOUSE_OUT, mouseListener);  } 




The tutorials I found about toggle buttons all add frames to the button, and/or a bunch of if else. Can someone help me, I feel i'm almost there.

Thanks

View Replies !    View Related
AS - Loading Number Of Images In One Swf File Dynamicly
I am working on php shopping site. I want to load different images in one swf file. Here is the example if you click plus button (agrandir) it will open popup and this is flash file.

do i need to make separate swf file for each product or can I use one swf to load all images one by one? is there any solution?:

View Replies !    View Related
How Do I Get The Name Of A Dynamicly Made Movieclip?
Hi there All, Man its been driving me nutts!!!!
I have been trying to get a heap of dynamicly created movieclips to have a getURL atached to it. so I need to know there names.
ARRRRR its killing me, Im not a coder.
this is the code. in the main stage,
---------------------------------------------
// register root as environment
Object.environment = this;

// create camera object
this.cam = {x:0, y:0, z:500, dx:0, dy:0, dz:-500};

// set environmental constants
this.fl = 1000;

// create 'space' to which all words will be attached
this.createEmptyMovieClip("space",1);
// center 'space' on the stage
space._x=300;
space._y=169;

// a string of words related to the wind
this.somewords = "wind breeze storm stormy tornado text space three dimensional infinite recursive instance object distort environmental atmospheric blow gush whoosh thrash whirl push roar rush caress flow swoop";
// convert the string of words into an array of words
this.wordList = new Array();
this.wordList = this.somewords.split(" ");

// create one instance for each word in the list
for (n=0;n<this.wordList.length;n++) {
// pick a word from the list
var word = Object.environment.wordList[n];
var x = random(600)-300;
var y = random(337)-169;
var z = random(Object.environment.fl*2)-Object.environment.fl;

// create an instance of the SpaceWord object
nombre = "word"+String(depth++);
initialization = {txtword: word, x: x, y: y, z: z};
space.attachMovie("spaceWord", nombre, depth, initialization);
}

this.onEnterFrame = function() {
this.cam.dz+=.5;
// move the camera to its destination
this.cam.x+=(this.cam.dx-this.cam.x)/10;
this.cam.y+=(this.cam.dy-this.cam.y)/10;
this.cam.z+=(this.cam.dz-this.cam.z)/30;
}

stop();

---------------------------------------------------------
and this is the code on the movieclip

#initclip
// constructor
function SpaceWord() {
// set up button functionality
this.btnSquare.onPress = function() {
//_root.current = this.name;
getURL(this._name);
// push the camera towards the word by setting destination just a bit in front
Object.environment.cam.dx = this._parent.x;
Object.environment.cam.dy = this._parent.y;
Object.environment.cam.dz = this._parent.z+Object.environment.fl*.9;
// disable and hide button
this.enabled = false;
this._visible = false;
};
// set continual function to render word
this.onEnterFrame = this.render;
}
// allow SpaceWord to inherit MovieClip properties
SpaceWord.prototype = new MovieClip();
// instance methods
SpaceWord.prototype.render = function() {
var zActual = Object.environment.fl+this.z-Object.environment.cam.z;
// has the object moved behind the camera?
if (zActual>0) {
// object is still visible
// calculate scale
var scale = Object.environment.fl/zActual;
// set position using camera as an offset
this._x = (this.x-Object.environment.cam.x)*scale;
this._y = (this.y-Object.environment.cam.y)*scale;
// set size
this._xscale = scale*100;
this._yscale = scale*100;
// set fog
this._alpha = 100 - 99 * zActual/Object.environment.fl*.5;
} else {
// object has moved behind camera
// reposition further down the line
this.z += Object.environment.fl*2;

// enable button
this.btnSquare.enabled = true;
this.btnSquare._visible = true;
}
};
SpaceWord.prototype.setWord = function(s) {
this.txtWord = s;
};
SpaceWord.prototype.setPosition = function(x, y, z) {
this.x = x;
this.y = y;
this.z = z;
};
// Connect the class with the linkage ID for this movie clip
Object.registerClass("spaceWord", SpaceWord);
#endinitclip


------------------------------------

View Replies !    View Related
Dynamicly Name MovieClips Within A Movieclip
Stuck again

Code:
function displaySelectedArray(whichArray, layoutMC, elementName, elementWidth, elementHeight)
{
layoutMC = layoutMC._name;
elementName = elementName.toString();
for(i=0; i<whichArray.length;i++)
{
trace("Teast "+whichArray.length)
//dynamicly attach mc's to print_mc
element = whichArray[i];
_root.print_mc[layoutMC].attachMovie(element, elementName+i, i);
_root.print_mc[layoutMC][elementName+i]._y = (elementHeight + 1)*i;
_root.print_mc[layoutMC][elementName+i]._width = elementWidth;
_root.print_mc[layoutMC][elementName+i]._height = elementHeight;
//for testing this one attach movie
_root.print_mc.test_mc.attachMovie(element, elementName+i, i);
}

}
this may not be clear for you but I think it has to do witth

Code:
_root.print_mc[layoutMC].attachMovie(element, elementName+i, i);
which doesn't work

this seems to work

Code:
_root.print_mc.test_mc.attachMovie(element, elementName+i, i);
Everything worked when I didn't put it all in print_mc


Code:
function displaySelectedArray(whichArray, layoutMC, elementName, elementWidth, elementHeight)
{
layoutMC = layoutMC._name;
elementName = elementName.toString();
for(i=0; i<whichArray.length;i++)
{
//dynamicly attach mc's
element = whichArray[i];
_root[layoutMC].attachMovie(element, elementName+i, i);
_root[layoutMC][elementName+i]._y = (elementHeight + 1)*i;
_root[layoutMC][elementName+i]._width = elementWidth;
_root[layoutMC][elementName+i]._height = elementHeight;
}

}

View Replies !    View Related
Printing A Dynamicly Generated Movieclip
Hi there,

wanted to ask You how to get exact control (eg. needed ActionScript-commands, needed variables) about printing dynamicly generated movieclip.

We want to print from an *.exe different Movieclip, depending on the generated Datas, we have different numbers of pages that are printed.
We need now exact control about the numbers of printed pages, numbers of rows etc.
We would like to programm something like "if there are 20 lines of text, print a page. Just go on printing until a page with zero lines comes, stop there"

Any Help would be great,
Thanks in advance

View Replies !    View Related
Getting Property From A Dynamicly Created Movieclip
I used "createEmptyMovieClip2 to create a movie that I use as an image holder.

I need to get the scale of it once the external .jpg image have been loaded but the getproperty function doesn't work, it give me 0 as a result. Any suggestions?

Thanks

View Replies !    View Related
Scrollbuttons For Dynamicly Loaded Movieclip
peepz,

i searched the whole forum mand tried many tutorials but i can't get it work...

i dont want to use the scrollpane....

i have two buttons (up and down) placed in a movieclip and they are viewable on the second keyframe (cause the are in a pulldown menu).

i also placed a mask in this movieclip named: "mcGetCategoriesContentMask", under this mask is an movieclip named: "mcGetCategories" wich dynamicly loads buttons so the lenght of this moveclip will vary...(the movie stops on the second keyframe)

so if someone can make easy to customize script so i can scroll my movieclip:"mcGetcategories" ot would be awesome

i now the trick (onClipEvent (enterFrame){
mcGetCategories._y += 5
}

but it have to work whitin my mask (the boundaries...)

so it stops when then mc is at his bottom in my mask.....

i really hope somebody an make this work

thnx for all your help

View Replies !    View Related
Scrollbuttons For Dynamicly Loaded Movieclip
peepz,

i searched the whole forum mand tried many tutorials but i can't get it work...

i dont want to use the scrollpane....

i have two buttons (up and down) placed in a movieclip and they are viewable on the second keyframe (cause the are in a pulldown menu).

i also placed a mask in this movieclip named: "mcGetCategoriesContentMask", under this mask is an movieclip named: "mcGetCategories" wich dynamicly loads buttons so the lenght of this moveclip will vary...(the movie stops on the second keyframe)

so if someone can make easy to customize script so i can scroll my movieclip:"mcGetcategories" ot would be awesome

i now the trick (onClipEvent (enterFrame){
mcGetCategories._y += 5
}

but it have to work whitin my mask (the boundaries...)

so it stops when then mc is at his bottom in my mask.....

i really hope somebody an make this work

thnx for all your help

View Replies !    View Related
Scrollbuttons For Dynamicly Loaded Movieclip ?
peepz,

i searched the whole forum mand tried many tutorials but i can't get it work...

i dont want to use the scrollpane....

i have two buttons (up and down) placed in a movieclip and they are viewable on the second keyframe (cause the are in a pulldown menu).

i also placed a mask in this movieclip named: "mcGetCategoriesContentMask", under this mask is an movieclip named: "mcGetCategories" wich dynamicly loads buttons so the lenght of this moveclip will vary...(the movie stops on the second keyframe)

so if someone can make easy to customize script so i can scroll my movieclip:"mcGetcategories" ot would be awesome

i now the trick (onClipEvent (enterFrame){
mcGetCategories._y += 5
}

but it have to work whitin my mask (the boundaries...)

so it stops when then mc is at his bottom in my mask.....

i really hope somebody an make this work

thnx for all your help

View Replies !    View Related
Attach A MovieClip Dynamicly Create ?
Is it possible to attach a movieClip dynamicly create ?
With attachMovie and ObjectRegisterClass ?
In this exemple below, duplicate the mc1 IN mc2

_root.createEmptyMovieClip('mc1', 1);
mc1.beginFill(0, 100);
mc1.lineTo(50, 0);
mc1.lineTo(50, 50);
mc1.lineTo(0, 50);
mc1.endFill();
//
_root.createEmptyMovieClip('mc2', 5);
mc2._x = 200

// code ?

mc2.attachMovie('mc1','mc3',10);

Thanks !

View Replies !    View Related
Flash Object That Dynamicly Loads Images From A Folder On My Web Server
Want to dynamicly load images from a folder on our web server. I am a senior programmer specializing in asp.net/c#/sql and I can prolly hold my own in Cold Fusion. What I need to do is get a list of files on the server side, pass the list into the flash object, then load the first image, fade it out and fade in the next image. Keep doing that until im out off images, and then start over. Im not good at Flash by all means, but im sure I can figure it out with some help. If anyone could help out that would be great! You can email me at brian@flutterbystudios.org or post on here..

I want to have a folder on my web server with images in it. IE. 1.jpg, 2.jpg. 3.jpg. I want the flash object to be able to get a list of the images and use those images. So if I add or remove an image, I dont have to rebuild the flash object. I know im somehow on the server side going to have to build the list of images since the flash object is a client site thing, but I dont have a problem writing server side code to hand a list of URL's with the images in it to the flash object. Im just not sure how to get the flash object to do what I want it to do.

Thanks in advance!

Brian D. Danford
FlutterBy Studios

View Replies !    View Related
Strange Problem In Creating A 360 Model With Dynamicly Loaded Images...?
Hi there,

I'm creating a 3D "spinaround" 360 model, from 40 images of the model.
I want the 360 "spin" to run as smooth as possible with the dynamicly loaded images.

I'm loading the images with a MovieClipLoader object, and afterward placing them on a timeline in another movieclip. I've created a layer for each image, because I couldn't get it to work when all placed in one layer.

Now I've tried a million different setups, but can't get it to work with more than 23 images???

Can't Flash handle more than the 23 images in a movieclip??? Or is it perhaps the number of movieclips in the main movieclip, with an image placed in each that is screwing things up...??

Here's a link to the flashmovie I've createt so far...

The first couple of turns to the right should run pretty smooth, but then it goes wrong...?

http://www.plusidentity.dk/360/MCL_2.html

Any suggestions will help, because I'm out of ideas.

/JBOY

View Replies !    View Related
Dynamicly Created Movieclip/sprite And .width Property
I have a question on WHEN you can read the width of a dynamically created sprite.

I have a gallery package - the gallery.as file creates a thumbContainer (MovieClip) and adds each thumbnail (sprite) in a for loop, iterating through an array.

Within the for loop, i try to trace the width of the thumbContainer, but it always returns 0. What gives? I need the final width to make some calculations for the scrolling of the thumbnails to work.

I can get the final width using certain methods, such as returning the width on MOUSE_MOVE. I was able to get the width using the eventListener Event.ADDED, but that stopped working when loading images off my server instead of locally (wtf is that about?).

Can anyone give some clarification on dynamically created containers and their properties (specifically reading their width property) ?

View Replies !    View Related
Place Images
Hello, i have three variables in flash wich holds the name of 3 images.
I want to place these images in a movieclip but all 3 should be placed next to each other. I do know how to place one image in the movieclip, but i dont know how to place the second and third in it at a different position.

This is just a simple example

Code:
image01 = "something.gif";

myMC.load(image01); //<--How load this image inside the movieclip at a position that i want?

View Replies !    View Related
Loading Multiple MCs Into The Same Place
Just imagine you have a typical web site interface: you have an index zone and a contents zone. Every time you choose an option in the index zone, a new MC content is loaded in the contents zone ("over" the previous content, in a higher level). What I want o know is if this process slows or not the loading of the MCs, because the different MCs go "adding" one after the other.

Do you figure out how I could optimize this scheme?

Thanks.

View Replies !    View Related
Needing Help Dynamicly Loading Jpeg File With Movieclip.loadmovie
Hi, I'm pretty new with flash and have been having a hard time with loading jpegs dynamicly. I need the .fla file size to be as small as possible (so imbeding them in the file is out.) I have managed to get them into a movieclip, but I have motion tweens and keyframes and the jpeg seems to only load into the keyframe in timeline where the script is, and dissappears at the next keyframe. I now have about 30 scripts loading images at every keyframe, which seems to work fine, except at some points, where the image dissappears off the screen for a fraction of a second, reveling the white background, and then re appears and continues playing. Any advice or help would be greatly appreciated.
Thanks.

View Replies !    View Related
Place Images From An Array
I would like to create a mass of images which doesn't have the same size/ratio.
The images cannot overlap, but they should be placed as close to each other as possible, so you get a big picture created by a lot of small ones.

Does it make sence?

View Replies !    View Related
Loading Dfiffernt Images In The Same Place
I would like to load a different graphic on to a page each time a different button is pressed in the same place or box. Also some scrolling text to change in my dynamic text box each time the corresponding button is pressed. I presume it would be best to have each image loading from a separete file on the server and have an the text html file on the server as well to save on the initial movie download time.
If anyone has any advice it would be appreciated.

View Replies !    View Related
[f8]reloading Fresh Images In The Same Place
normally this works for me, but i am not getting the correct results...essentially, every time i call loadThumbImages i woudl like to start a new set of images exactly where the old ones were (same starting _x and _y)...any idea why the the next set of thumbs (after a new call) load immediately where the previous set left off??? shouldn't mcHolder be removed and replaced with exactly the same mc?


Code:
function loadThumbImages(thumbXML) {
var mcHolder = this.createEmptyMovieClip("mcHolder", 2000);
root = thumbXML.firstChild.childNodes;
var nX:Number;
var nY:Number;
for (var i = 0; i<=root.length-1; i++) {
thumbs = root[i].firstChild;
mcImage = mcHolder.createEmptyMovieClip(i, i);
createThumbs(thumbs);
}
}
function createThumbs(thumbs) {
var mclListener:Object = new Object();
var mclLoader:MovieClipLoader = new MovieClipLoader();
mclLoader.addListener(mclListener);

mclListener.onLoadInit = function(mcClip:MovieClip) {
nextColumn = mcClip._width+5;
var newY = 30;
if (nX == undefined) {
nX = 800-(mcClip._width);
nY = newY;
}
if (nY>=450) {
nX -= nextColumn;
nY = newY;
}
mcClip._x = nX;
mcClip._y = nY;
nY += mcClip._height+5;
};
mclLoader.loadClip(rootURL+"images/"+galleryID+"/"+galleryID+"-Thumbnails/"+thumbs, mcImage);
}

View Replies !    View Related
Place A Movieclip
How can I place a movieclip on the stage using actionscript?

as quesiton

View Replies !    View Related
Multiple Txt Files, Scrollbar In Wrong Place.
I'm loading a new text file into my dynamic text field everytime the user clicks one of three buttons. The problem occurs when you scroll down. If you then click another button to load the new text the damn scrollbar stays where it is, leaving the new text half way down instead of the scrollbar starting at the top.

Anything I can do to make the scrollbar start from the top everytime a new txt file loads?

View Replies !    View Related
Load Images Via XML And Place On Stage Horizontally.
Alright folks. A while back I got some help with making a movie clip draggable. I've got that working without any issues. However, I'm loading in some images via XML.

Each of these images will be placed within the draggable movieclip called imagecontainer_mc. I want to create a large horizontal image with each one placed next to each other. The user can drag through them instead of scrolling horizontally.

Here's an example of how the site will look with static images.
http://www.defiancevisual.com/flashtest01.swf

I've got the XML in my flash document, and I've got loops that trace the image location and widths back to me.

http://www.defiancevisual.com/gallery/ is my XML.

I'm stuck when it comes to image placement. I think my approach to creating a movie clip and tossing an image in it all within imagecontainer_mc isn't working. Could anyone point me in the right direction?


Code:
#include "lmc_tween.as"

//Make the stage fluid
Stage.align = 'TL';
Stage.scaleMode = 'noScale';

//Initialize image container
imagecontainer_mc._x = 0;
imagecontainer_mc._y = 0;
//imagecontainer_mc._y = ((Stage.height / 2) - (imagecontainer_mc._height / 2));

//Initialize menu items
logo_mc._y = 0;
logo_mc._x = 0;
navigation_mc._x = Stage.width - navigation_mc._width;
navigation_mc._y = 0;
music_mc._x = Stage.width - music_mc._width;
music_mc._y = Stage.height - music_mc._height;
tagline_mc._x = 0;
tagline_mc._y = Stage.height - tagline_mc._height;


//Place the items accordingly on resize
sizeListener = new Object();
sizeListener.onResize = function() {

imagecontainer_mc.tween("_y", ((Stage.height / 2) - (imagecontainer_mc._height / 2)), 1, "easeInOutExpo");
navigation_mc._x = Stage.width - navigation_mc._width;
music_mc._x = Stage.width - music_mc._width;
music_mc._y = Stage.height - music_mc._height;
tagline_mc._y = Stage.height - tagline_mc._height;
};

Stage.addListener(sizeListener);

//Set the variables of the drag physics
decel = .8;
ratio = .5;
padding = 100; //in pixels

var dragX:Number;
var dragY:Number;

//Keep the horizontal drag within the bounds of the stage
MovieClip.prototype.checkBounds = function () {

if (this._x <= Stage.width - imagecontainer_mc._width - (Stage.width - padding)) {
this._x = Stage.width - imagecontainer_mc._width - (Stage.width - padding);
}

if (this._x >= 0 + (Stage.width-padding)) {
this._x = 0 + (Stage.width-padding);
}

if (this._y >= Stage.height - padding) {
this._y = Stage.height - padding;
}

if (this._y <= 0 - (imagecontainer_mc._height - padding)) {
this._y = 0 - (imagecontainer_mc._height - padding);
}
};

imagecontainer_mc.onEnterFrame = function () {
if (!drag) {
this._x += xspeed *= decel;
this._y += yspeed *= decel;
} else {
x = this._x;
this._x = this._parent._xmouse - dragX;

y = this._y;
this._y = this._parent._ymouse - dragY;
}

this.checkBounds ();
};

imagecontainer_mc.onPress = function () {
dragX = this._xmouse;
dragY = this._ymouse;

drag = true;
};

imagecontainer_mc.onRelease = imagecontainer_mc.onReleaseOutside = function () {
drag = false;

xspeed = (this._x - x) * ratio;
yspeed = (this._y - y) * ratio;

this.checkBounds ();
};

oldx = _root._xmouse;
oldy = _root._ymouse;

function loadXML(loaded) {
if (loaded) {
albumsNode = this.firstChild.childNodes;
albumtotal = albumsNode.length;
albums = [];

//initialize p
p = 0;

for (a=0; a<albumtotal; a++) {
albums[a] = this.firstChild.childNodes[a].attributes.title;

//trace(albums[a]);

imagesNode = this.firstChild.childNodes[a].childNodes;
imagestotal = imagesNode.length;
imageurl = [];
imagewidth = [];

for (i=0; i<imagestotal; i++) {

imageurl[i] = this.firstChild.childNodes[a].childNodes[i].attributes.url;
imagewidth[i] = this.firstChild.childNodes[a].childNodes[i].attributes.width;


//trace(imagewidth[i]);
image();
}
}
} else {
trace("There was an error loading the file.");
}
}

xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("http://www.defiancevisual.com/gallery/");

function image() {
if (loaded == filesize) {
picturemcname = "image_mc" + i;

picture = imagecontainer_mc.createEmptyMovieClip(picturemcname, i);
picture.loadMovie(imageurl[i]);

//p = number(imagewidth[i]) * -1;
p = p + number(imagewidth[i]);
trace(p);

imagecontainer_mc.picturemcname._x = p;
}
}

Am I approaching this wrong?

View Replies !    View Related
Movieclip In The Wrong Place
Why is my movieclip at top right corner? It needs to be in the middle of the stage. I have the following code place on the movieclip:

Code:
onClipEvent (load) {
loadMovie("AutumnRetirementVillage.swf", 20);
}

View Replies !    View Related
Please Help Place Movieclip Above Others On Same Layer...
Hi,

I have a flash movie with a number of objects movieclips that can be dragged and dropped onto target movieclips.

The object movieclips are all on the same layer and therefore when dragging some appear above and some appear below each other.

I want whichever object movieclip is being dragged to appear above the others.

Can I do this with _levels or is this just for external swf files? Is there a way to tell the movieclip to move up a layer?

I'm really stuck ont this so any suggestions would be greatly appreciated

Thanks,
Rik

View Replies !    View Related
Please Help Place Movieclip Above Others On Same Layer..
Hi,

I have a flash movie with a number of objects movieclips that can be dragged and dropped onto target movieclips.

The object movieclips are all on the same layer and therefore when dragging some appear above and some appear below each other.

I want whichever object movieclip is being dragged to appear above the others.

Can I do this with _levels or is this just for external swf files? Is there a way to tell the movieclip to move up a layer?

I'm really stuck ont this so any suggestions would be greatly appreciated

Thanks,
Rik

View Replies !    View Related
[F8] Place The Movieclip In The Centre
I have a Movieclip that I like to place in the centre of the flash.
Even if I change the size of the flash I like to have that in the centre.

The movieclip is 200x200 but I can't make the movieclip in the centre


Code:
Stage.scaleMode="NoScale";

setProperty(mctest, _x, (Stage.width-100)/2 );
setProperty(mctest, _y, (Stage.height-100)/2 );

var resizeListener:Object = new Object();
Stage.addListener(resizeListener);

resizeListener.onResize = function () {
setProperty(mctest, _x, (Stage.width-100)/2 );
setProperty(mctest, _y, (Stage.height-100)/2 );
}

/EDIT
I have maybe found the problem
If I use mctest._width and mctest._height insted of 100 it work
The flash is now 800x600 but I maybe going to change the size later.

I going to have a movieclip in the centre and one in the bottom right.

View Replies !    View Related
Moving A Movieclip From A Place To Another
Hello,

First, let me tell you that in actionscript I'm a beginner. I do know flash - but mostlly for animation and other similar stuff.

Recently I have decided that is time to learn actionscript, searched on the net and I have found this site - great one (especially for tutorials). i have learned some stuff and now I'm trying to build a whole web site using Flash MX, having as a model this: click here.
This is a tutorial for Flash MX 2004 (link) - using tweens, but I'm trying to re-create the whole thing in Flash MX (since I can't afford to upgrade my Flash MX yet ).

Where I am stuck?

Well ... making stuff moving around ("with ease in" too) is quite simple. i got that.

However ... I can not suceed in keeping the last coordinates of the buttons (_x and _y), so I can make the buttons move from the last place where they were.

To make it a little bit more clear ... on the "home" label, the buttons are comming on the stage from the corners down to the middle of the scene. Once you click on the test button, then they move up-left (on the "tools" label). If you click on Home again, that it will take you back on the "home" label and it will make the buttons move from the top-left corner back to the middle again.

But for me doesn't really work like that - and I am killing myself to find ways to get the last coordinates takes so I can make them move from there.

Any help will be greatlly apreciated - and hopefully someone will understand my sorry English .

Thank you!

View Replies !    View Related
How To Stop Movieclip On Particular Place
Hi everyone

i want to be stopped my movieclip on particular place.

here given code


onClipEvent(enterFrame)
{
this._y -= 2;
}

this code helps me to move movieclip. its ok but when it reaches 20 then i want to be stopped how can i do so ?

Please help me.

thanx in advance
waiting

View Replies !    View Related
FL8: Cannot Place Components Within MovieClip, Why?
Top of the mornin' to ya'll,

I've got a lame situation. I need to utilize Kirupa's tutorial of scrolling for a visual playback. Problem is, I need to have multiple UI Combo Boxes components within the necessary contentMain_mc.

When I make a movie clip with components inside it, their label display no longer functions or displays.

Any ideas around this?

Thanks,

Rick

Problem File

View Replies !    View Related
Multiple Button Clicks Before Action Takes Place
I'm creating a simple color wheel mixer... there are three buttons: red, yellow and blue. I want to be able to select red and then yellow buttons... then go to the orange frame... or select yellow and then red buttons and go to the orange frame, etc... I'm sure there's an "if" "else" way of doing this in as3... any thoughts? I don't want to use check boxes... just buttons.

Plans are in the works for a 6+ color wheel... hmmm.

Thanx

View Replies !    View Related
How To Place Images Inside Dynamically Loaded Text
I'm wondering if anyone could advise me on how to place images inside dynamically loaded text.

I have a textfield loading text from an external file - I'd like to have images wrapped in the text, like any html page - any ideas?

I tried using html <image> tags to mark up a layout, but flash doesn't really support html, not really, they say they do, but really they only support <a> and a few other tags - woot!

Thanks!

View Replies !    View Related
Panning A Movieclip Then Stopping It In A Certain Place.
Hi, I am working on a project where I have a large map of a city that is too big to fit on screen so I need to be able to pan it north south east and west using buttons placed at the different compass points. I will use a mask to only show the relevant portion of the map on screen. How can I get the map to pan using these four buttons. This is the code I am using under one of the buttons (East):

on (press) {
map._x += 10;
}

A feeble effort I know, but all this does is make the map 'jump' 10 pixels to the right, and I want it to scroll smoothly.

My second problem is that I need the map to stop scrolling when it reaches a certain point, I imagine this can be achieved in the form of an if statement (i.e. if map reaches this point then stop). I know this is probably a walk in the park for most of you guys, but I'd appreciate the help as I'm a relative newcomer to AS.

Cheers.

View Replies !    View Related
Link Inside Movieclip Goes Wrong Place
Hi,

I'm using Flash MX and I've got an issue with my menu. The thing is, when you put the mouse over the menu, it rolls out (see code on screenshot #1)... but when I make more than one button in that movieclip, it all goes to the same place. So if I got one button linked to "one", and a different button linked to "two", they both end up going to "one"... see my case?


I would be most grateful for any help. Please look at the screenshots.



Screenshot #1 Screenshot #2



Cheers!

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