Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using any component as a Container and calling the Image in to the Container using action script.

New Here ,
Apr 23, 2013 Apr 23, 2013
Hi all,
I am doing an experiment on "Using any component as a Container and calling the Image on to the stage using action script." as I am a new user to "Action Script3.0" Can some One please help Me, what is the best aproach to reach My goal thanks a lot

Message was edited by: Naveen.Lingam

TOPICS
ActionScript
639
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 23, 2013 Apr 23, 2013

Why are you quoting that?  Where does it come from?  By itself it can't work so a more detailed explanation of what it involves will help.

If this is an experiment, what is the goal of it?  I would think the goal of an experiment is to find an answer by trial and error.  You seem to be asking someone else to do that work for you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 23, 2013 Apr 23, 2013

Brother sorry You have mistaken, I am not asking any one to do My work, I am requesting initial inputs to start working with Action Script 3.0 since I am new to it.

Yeah let Me explain You My Goal :

I have to work with a tool called 'ADTECH CANVAS' in future which is a rich media Ad service. Adtech has it own flash components which helps creating Flash Advertisments easy(here is the link for better understanding http://canvas.adtech.com/docs/building-templates/). Let Me explain You with a smal example (When an image called to the stage using Action script along with the Adtech flash component, I get a chance to change the image in any point of time Using Adtech Canvas tool).

I got into this assignment just today, so just started expermenting on small things like, how to call a Image on to the stage when a button click. I achived some how using the below code : button instance name is=button01 and image instance name=image01

button01.addEventListener(MouseEvent.MOUSE_OVER, image01);

function image01(event:MouseEvent):void

{

          var libImage:char01 = new char01();

          var holder:Bitmap = new Bitmap(libImage);

          addChild(holder);

}

But some how I dnt have a control on where my image shud exactly placed, for example center of my stage. pleae help Me if could understand My request. thanks a lot.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 23, 2013 Apr 23, 2013

function image01(e:MouseEvent):void

{

     var holder:Bitmap = new Bitmap(new char01());

     holder.x = Math.round((stage.stageWidth - holder.width) * .5);

     holder.y = Math.round((stage.stageHeight - holder.height) * .5);

     addChild(holder);

}

That should center your image for you - you just need to set x and y properties of your Bitmap.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 24, 2013 Apr 24, 2013
LATEST

Thanks Brother, its really help full . thank you so much for your time.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines