In a heavy saucepan, over medium heat, melt butter. Add corn syrup and sugar. Bring to a boil and boil for 5 minutes, stirring constantly. Combine flour with ½ can of sweetened condensed milk. Add remaining milk and flour mixture to pan. Heat mixture until it reaches 235°F on a candy thermometer, stirring constantly. Be very careful, mixture will be HOT! Remove from heat and stir in vanilla. Cool mixture until it is thick enough to dip apples. Dip apples in mixture, then roll in pecans, if desired. Cool on wax paper. If mixture becomes too thick, warm up a little or add a little water. Left over caramel makes delicious candy.